Run SQL statements from a textbox
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