I am fetching a query stored in the database, attempting to execute it with parameters, and then handle the result.
DECLARE
SQLSTR VARCHAR(5000);
BEGIN
SELECT SelectString INTO SQLSTR FROM MySelectTable WHERE Name = 'QueryOfDoom';
EXECUTE IMMEDIATE SQLSTR USING 1;
END;
The query executes but nothing is returned. I've searched around on here and found you can't return data from a bloc. That's fine. However how can I get data out? Since it's dynamic it strikes me as cumbersome if I had to define a table structure to bulk collect the data and subsequently select from. Is there a easier way?