Ad-Hoc SQL
681902Jan 27 2009 — edited Mar 6 2009I'm adding ad-hoc SQL capabilities for Oracle to my application (the application is a database development tool). Essentially, the user has a text editor that they use to type what ever SQL they want. I need to give them a way to execute it. What they execute may consist of 1 individual SQL statement or it may contain many. For example, they may run this all at the same time:
SELECT * FROM TABLEA;
SELECT * FROM TABLEB;
INSERT INTO SOMETABLE
SELECT * FROM ANOTHERTABLE;
DECLARE
Var NUMBER;
BEGIN
Var := 1;
END;
and so on.
I would need to execute this and produce 4 distinct set of results for the user. Can I pass all of this to Oracle? Will Oracle know what to do with this? Will Oracle give me results for the 4 individual statements? Do I need to parse each statement on my own and send them to Oracle one at a time?
I'm trying to figure out how to go about developing this solution. I'm doing this in a PowerBuilder application if that makes any difference.
Thanks,
Brad