Run multiple commands in one ExecuteScalar in Oracle

Konstantinos picture Konstantinos · Mar 26, 2009 · Viewed 8k times · Source

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

Answer

Mitch Wheat picture Mitch Wheat · Mar 26, 2009

Try wrapping with a BEGIN..END

BEGIN insert into.... ; insert into.... ; delete .........; END;