Multiple Queries

Morning! I have to write a procedure which will accept a record type and the number of records to return to the calling PHP script. We have a similar script which gets data from a single query and opens a SELECT statement for PHP like this: OPEN line FOR v_query; But in this case, I may get multiple pairs of parameters at one time.