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