dbTalk Databases Forums  

Overflow on SUM of a column defined as INT

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Overflow on SUM of a column defined as INT in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Martin
 
Posts: n/a

Default Re: Overflow on SUM of a column defined as INT - 09-13-2010 , 11:52 PM






Quote:
On Sep 12, 9:17 pm, Serge Rielau <srie... (AT) ca (DOT) ibm.com> wrote:
Not that in DB2 9.7 FP3 there is also a "connect procedure" which allows
you to force e.g. a SET PATH statement onto any session.
Is this a client feature or server feature? Do you know where it is
documented?

Reply With Quote
  #22  
Old   
Martin
 
Posts: n/a

Default Re: Overflow on SUM of a column defined as INT - 09-13-2010 , 11:59 PM






Quote:
Because data type of edlevel used in sum(edlevel) is SMALLINT, so
sysibm.SUM is "best fit" to sum(edlevel) than db2inst1.SUM which takes
INT as a parameter.
OK, my apologies. It does work when doing a SUM on INT column with my own
UDF and the set path does work. I didn't understand (or I didn't believe)
that there was a distiction between SUMing a SMALLINT and INT, but there
obviously is.

Now I just need to to figure out how to automatically set the path for
ad-hoc users (they will not do it manually). Looks like 9.7 PF 3 may do
that, but waiting on FP3 for the Linux 64-bit version for AMD/Intel to be
released.

Reply With Quote
  #23  
Old   
Helmut Tessarek
 
Posts: n/a

Default Re: Overflow on SUM of a column defined as INT - 09-14-2010 , 12:21 AM



On 14.09.10 0:52 , Martin wrote:
Quote:
Is this a client feature or server feature? Do you know where it is
documented?
This is a server feature, implemented as a db configuration parameter.

See: http://bit.ly/c6T8ay

--
Helmut K. C. Tessarek
DB2 Performance and Development

/*
Thou shalt not follow the NULL pointer for chaos and madness
await thee at its end.
*/

Reply With Quote
  #24  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Overflow on SUM of a column defined as INT - 09-14-2010 , 09:16 AM



On 9/14/2010 1:21 AM, Helmut Tessarek wrote:
Quote:
On 14.09.10 0:52 , Martin wrote:
Is this a client feature or server feature? Do you know where it is
documented?

This is a server feature, implemented as a db configuration parameter.

See: http://bit.ly/c6T8ay

db2 => CREATE OR REPLACE PROCEDURE SERGE.ON_CONNECT() SET PATH MYSTUFF,
CURRENT PATH;
DB20000I The SQL command completed successfully.
db2 => UPDATE DB CFG USING CONNECT_PROC 'SERGE.ON_CONNECT';
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
db2 => VALUES CURRENT PATH;
1
--------------------------------------------------------------------
"SYSIBM","SYSFUN","SYSPROC","SYSIBMADM","SERGE "
1 record(s) selected.

db2 => CONNECT RESET;
DB20000I The SQL command completed successfully.
db2 => CONNECT TO TEST;

Database Connection Information

Database server = DB2/NT 9.7.3
SQL authorization ID = SERGE
Local database alias = TEST

db2 => VALUES CURRENT PATH;
1
---------------------------------------------------------
"MYSTUFF","SYSIBM","SYSFUN","SYSPROC","SYSIBMADM", "SERGE"
1 record(s) selected.

db2 =>

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.