ORA-00911: invalid character trying to execute multiple statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code:

OracleCommand cmd = new OracleCommand( sql, connection );
cmd.ExecuteNonQuery();

Whenever I try to execute the following SQL, which works fine in Oracle's
SQL tool, I get the invalid character error. I tried removing the semicolon,
but then I got a different error.

truncate table tmp_as_stock;

insert into tmp_as_stock (
ITEM
, MODEL
, TYPE
)
select
ITEM
, MODEL
, TYPE
from
source.CI_STOCK

Any ideas? Is it possible to execute multiple statements with
ExecuteNonQuery or other function?
 
I don't know about oracle, in SQL server this would work if the statements
were separated by semicolon.

Also, ExecuteNonQuery is not at all the equivalent of query analyzer or any
other tools for other systems. It cannot do all that those can do. For
example, ExecuteNonQuery doesn't process GO statements. So you can't run an
arbitrary SQL script using that.
 
Back
Top