IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to use LENGTH function on a UDT/DISTINCT type


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GANAPATH

New User


Joined: 06 Mar 2006
Posts: 35

PostPosted: Tue Feb 06, 2007 2:32 am
Reply with quote

Hi,

I have a UDT(user defined datatype) column which is of LOB type, and iam unable to use 'LENGTH' function on this Column.

The same thing if i don't declare it as a UDT but as a regular LOB column, i can use LENGTH function on that column, can anyone tell me how i can use 'Lenght' function on a UDT.

select length(lobcol1) from table ;

this shows me results but if i use

select length(udtlobcol1) from table ;<- this gives me

DSNT408I SQLCODE = -440, ERROR: NO FUNCTION BY THE NAME LENGTH HAVING COMPATIBLE ARGUMENTS WAS FOUND IN THE CURRENT PATH


Thanks,
Ganapath
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 2:58 am
Reply with quote

Call me confused icon_confused.gif
DB2, right?
UDT as in User Defined Tatatype?
DSNT408I as in "DSNT408I SQLCODE = -xxx, explanation"?
-440 as in " -440 THE NUMBER OF PARAMETERS IN THE PARAMETER LIST DOES NOT MATCH THE NUMBER OF PARAMETERS EXPECTED FOR STORED PROCEDURE name, AUTHID authid, LUNAME luname. number PARAMETERS WERE EXPECTED."?
Obviously I'm missing something, where is the UDT documented, please? icon_sad.gif The closest I could find were user defined table functions.....
Back to top
View user's profile Send private message
GANAPATH

New User


Joined: 06 Mar 2006
Posts: 35

PostPosted: Tue Feb 06, 2007 3:19 am
Reply with quote

Hi,

User defined data types are also referred to as Distinct types

u can read the information in the below link.
publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dsnsqj10/5.24?ACTION=MATCHES&REQUEST=user+defined+data+type&TYPE=FUZZY&SHELF=&DT=20040216135741&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

or u can see SQL reference Guide v8 under STATEMENTS,DISTINCT TYPES

Thanks,
Ganapath
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:55 am
Reply with quote

Thanks for the url, down towards the bottom of that page (I think) was this
Quote:
Built-in functions: When a distinct type is defined, the built-in functions (such as AVG, MAX, and LENGTH) are not automatically supported for the distinct type. You can use a built-in function on a distinct type only after a sourced user-defined function, which is based on the built-in function, has been created for the distinct type. For information on defining sourced user-defined functions, see "CREATE FUNCTION (sourced)" in topic 5.28.
Good luck..... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Calling an Open C library function in... CICS 1
Search our Forums:

Back to Top