I decided to take a different approach to this predicament - which involves piecing together a long string like "SELECT FIELD INTO something FROM SOMETABLE WHERE CRITERIA=2"... Now I would like to pass this string into a stored function and then be able to execute it. So I think I would call the function via 'exec functionname(string)', it would then go into the function, execute that string (which is just a complex SQL statement) and return the values.
I decided on this alternative rather than composing the SELECT statement within the function for simplicity sakes. My program already has put the SQL statement togther but I'd like to be able to pass it to the function.
Thanks,
Sean Dolan