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.

Thanks Alan.
Actually, I have many procedures that are going to use the result from get_id, and the logic in get_id is quite complicated. Seems not a good idea to combine the query inside get_id with other queries in each of the procedures.

Looping through the result from get_id to do select at each time will be very inefficient for my case too.