dbTalk Databases Forums  

FYI: DB2 9.7.4 has been released with new SQL function

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


Discuss FYI: DB2 9.7.4 has been released with new SQL function in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Fin
 
Posts: n/a

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-03-2011 , 03:27 PM






Many thanks Helmut,

That did the trick, problem solved.

Cheers, Fin.

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

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-04-2011 , 10:52 AM






Background:
Whenever a new built-in function is added to DB2 it gets a version-stamp.
This is to avoid overriding a pre-existing user defined function of the
same name which may be an equally good match.
By running db2upd you move the version stamp of the DB forward which
makes the new function visible.

Cheers
Serge

--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: tinyurl.com/SQLTips4DB2
Wiki: tinyurl.com/Oracle2DB2Wiki
Twitter: srielau

Reply With Quote
  #13  
Old   
AD
 
Posts: n/a

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-13-2011 , 03:52 AM



Why LISTAGG doesn't support distinct values ex. listagg(distinct
COLUMN,',')? Such statement executes but doesn't work. Maybe in future
release?

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

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-13-2011 , 08:49 AM



On 5/13/2011 4:52 AM, AD wrote:
Quote:
Why LISTAGG doesn't support distinct values ex. listagg(distinct
COLUMN,',')? Such statement executes but doesn't work. Maybe in future
release?
Interesting. Can you open a PMR? I'll take a look. If it's possible to
support (off hand I don't see why not), I'll fix it, otherwise I'll need
to block it properly.
Ignoring the keyword is definitely wrong *eggontheface*.

Refer support to me directly.

Cheers
Serge
--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: tinyurl.com/SQLTips4DB2
Wiki: tinyurl.com/Oracle2DB2Wiki
Twitter: srielau

Reply With Quote
  #15  
Old   
Tonkuma
 
Posts: n/a

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-13-2011 , 10:18 AM



On May 13, 10:49*pm, Serge Rielau <srie... (AT) ca (DOT) ibm.com> wrote:
Quote:
On 5/13/2011 4:52 AM, AD wrote:> Why LISTAGG doesn't support distinct values ex. listagg(distinct
COLUMN,',')? Such statement executes but doesn't work. Maybe in future
release?

Interesting. Can you open a PMR? I'll take a look. If it's possible to
support (off hand I don't see why not), I'll fix it, otherwise I'll need
to block it properly.
Ignoring the keyword is definitely wrong *eggontheface*.

Refer support to me directly.

Cheers
Serge
--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: * *tinyurl.com/SQLTips4DB2
Wiki: * *tinyurl.com/Oracle2DB2Wiki
Twitter: srielau
A workaround may be LAG and NULLIF, like...

------------------------------ Commands Entered
------------------------------
SELECT workdept
, COUNT(*) AS members
, SUBSTR(
LISTAGG( VARCHAR( NULLIF(edlevel , lag_edlevel) ) , ' ' )
WITHIN GROUP(ORDER BY edlevel)
, 1 , 20 ) AS distinct_edlevel
FROM (SELECT e.*
, LAG(edlevel)
OVER(PARTITION BY workdept
ORDER BY edlevel) AS lag_edlevel
FROM employee e
) e
GROUP BY
workdept
;
------------------------------------------------------------------------------

WORKDEPT MEMBERS DISTINCT_EDLEVEL
-------- ----------- --------------------
A00 3 14 18 19
B01 1 18
C01 3 16 18 20
D11 9 16 17 18
D21 6 14 15 16 17
E01 1 16
E11 5 12 14 16 17
E21 4 14 16

8 record(s) selected.

Reply With Quote
  #16  
Old   
AD
 
Posts: n/a

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-13-2011 , 03:08 PM



Quote:
Interesting. Can you open a PMR? I'll take a look. If it's possible to
support (off hand I don't see why not), I'll fix it, otherwise I'll need
to block it properly.
Ignoring the keyword is definitely wrong *eggontheface*.
I'm quite new to DB2 and using Express-C only so I don't know how to
open PMR (which seems to be available to customers only).

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

Default Re: FYI: DB2 9.7.4 has been released with new SQL function - 05-16-2011 , 07:33 AM



On 5/13/2011 4:08 PM, AD wrote:
Quote:
Interesting. Can you open a PMR? I'll take a look. If it's possible to
support (off hand I don't see why not), I'll fix it, otherwise I'll need
to block it properly.
Ignoring the keyword is definitely wrong *eggontheface*.

I'm quite new to DB2 and using Express-C only so I don't know how to
open PMR (which seems to be available to customers only).
IC, no problem.

--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: tinyurl.com/SQLTips4DB2
Wiki: tinyurl.com/Oracle2DB2Wiki
Twitter: srielau

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.