Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run multiple commands in one ExecuteScalar in Oracle

I have a batch of sql statements such as ...

insert into.... ; insert into.... ; delete .........;

etc

When i try to execute them against oracle it gives me this error (ORA-00911 Invalid Character)

now i can understand that this is because of the semicolon between the statements, i tried this on SQL Server and it worked but in Oracle no luck so far.

Is there a way to run multiple statements against oracle by using the ExecuteScalar or some other function?


DUPLICATE: How can I execute multiple Oracle SQL statements with .NET

like image 795
Konstantinos Avatar asked Mar 26 '09 13:03

Konstantinos


1 Answers

Try wrapping with a BEGIN..END

BEGIN insert into.... ; insert into.... ; delete .........; END;
like image 51
Mitch Wheat Avatar answered Oct 03 '22 00:10

Mitch Wheat