Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    1

    Unanswered: 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! ^^

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Do you get the error creating the UDF or running it?

    Andy

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Also please provide you DB2 version and OS.

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •