Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Run SQL statements from a textbox

Alistair LaingSep 19 2007 — edited Sep 20 2007
Hi

I'm trying to execute multiple insert/update or Delete statements from a textarea of a page. I'm basically trying to replicate the same functionalility as SQL Workshop for users to access and run sql statements for it.

I know in SQL workshop you can run multiple insert/update or delete statements using the following syntax:

begin
insert into table_1 (col1,col2)values('WER','QWE');
Insert into table_1 (col1,col2)values('ABC','DEF');
End;
/

I have created a textarea called :P1_SQL with a submit button which when pressed it runs the execute immediate :P1_SQL. It works if its a single insert command. I've tried the begin...end option which bring up the following error message:

ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "begin was inserted before "" to

Any ideas how I could get this to work?

Message was edited by:
Funkymonkey2
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2007
Added on Sep 19 2007
10 comments
746 views