Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to use LENGTH function on a UDT/DISTINCT type

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to use LENGTH function on a UDT/DISTINCT type
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 2:58 am    Post subject:
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    Post subject: Re: how to use LENGTH function on a UDT/DISTINCT type
Reply with quote

Hi,

User defined data types are also referred to as Distinct types

u can read the information in the below link.
http://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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 06, 2007 3:55 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us