I need to write a function that returns a recordset from a query based on the results of a prior query. something like this (I assume that this will NOT work, but something that acheives that purpose would be perfect:
the_name character varying := select thename from sometable where id = $1
select * from othertable where name = the_name
does that make sense at all?