Oracle: Multi-SQL statements

  • Thread starter Thread starter Banghe
  • Start date Start date
B

Banghe

Hi,

when I build such SQL statements:

sqlString ="DELETE FROM MYTBL1 WHERE RECID=1; DELETE FROM MYTBL2 WHERE
RECID=2;"

Using OracleClient1.1 (Incl. in Dot Net 1.1)

got error:
Invalid Character.

Such sqlString send to MS Sql Server without any problem.

I know this is a question related to Oracle, not dot net. But any one
knows?

Thanks,

Bangh
 
Hi Bangh:
sqlString ="DELETE FROM MYTBL1 WHERE RECID=1; DELETE FROM MYTBL2 WHERE
RECID=2;"

Using OracleClient1.1 (Incl. in Dot Net 1.1)

got error:
Invalid Character.

Such sqlString send to MS Sql Server without any problem.

I know this is a question related to Oracle, not dot net. But any one
knows?


Unless Oracle has changed in the last few months -- they dont' support multiple
sql statements (I believe this is a TSQL implementation).

Doug.
 
Hi Dough,

I found the previous post and get the solution. In this case, need to use the
"Block" with Begin blah;blah; ...; blah end;.
It works fine now.

But the guy who gave this answer said ";" is not a valid statement terminator in
SQL.

I strong disagree. Maybe he wanted to say it is NOT a valid statement terminal in
Oracle SQL version.

Thanks,

Bangh
 
Banghe said:
Hi Dough,

I found the previous post and get the solution. In this case, need to use the
"Block" with Begin blah;blah; ...; blah end;.
It works fine now.

But the guy who gave this answer said ";" is not a valid statement terminator in
SQL.

I strong disagree. Maybe he wanted to say it is NOT a valid statement terminal in
Oracle SQL version.
Yes I meant to say that ";" is not a valid statement seperator in Oracle
SQL.
It is the statement terminator, you just cant submit multiple statements in
the same command.
Either one SQL statement, or one PL\SQL block.

David
 
Back
Top