If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem with scalar / table UDF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-06, 11:42
shadowmaster shadowmaster is offline
Registered User
 
Join Date: Oct 2006
Posts: 1
Problem with scalar / table UDF

Hello. I am creating a function that i *need* it to return a scalar value (a VARCHAR)... however it must access a Table to get the value thru a query. I am doing this

RETURN select VARCHAR(field) from SCHEMA.TABLE where TABLE_ID=491496
and ANOTHER_FIELD=6

If i hardcode the "491496" it just works fine, however, when i replace the 491496 for the input variable on the Function, i get an error message stating it returns just more than one row (even though it doesn't). If this is a limit feature of DB2 since it doesn't know by a variable name if it can return more than one row, how can i go around it? I need the scalar value!
Thanks in advance! ^^
Reply With Quote
  #2 (permalink)  
Old 10-03-06, 13:12
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Do you get the error creating the UDF or running it?

Andy
Reply With Quote
  #3 (permalink)  
Old 10-03-06, 13:13
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Also please provide you DB2 version and OS.

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On