Oracle: Multi-SQL statements

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
 
D

Douglas Marquardt

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.
 
B

Banghe

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
 
D

David Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top