I have a VB6 application which reads blocks of SQL statements from a text
file, and executes them via the ADO .Execute method. The command that is
being sent through to the .Execute method will contain multiple SQL
This works perfectly for SQL Server. The application has now being modified
to work also on Oracle (the SQL is very similar).
A typical batch of statements is shown below, and typically consists of
CREATE/SELECT/UPDATE/INSERT INTO statements. Nothing fancy. Each statement
may span multiple lines; in addition the statements are obviously separated
by CR/LF and the TAB character appears in places.
I've had problems with the MS Oracle ODBC driver returning invalid character
after the ADO .Execute method has been submitted.
Do I need to include the ORACLE statement terminator (;) after every
statement in the batch? are -- comments acceptable?
Do I need a COMMIT; after a CREATE TABLE and before any other commands (such
as SELECT) which use it in the same batch?
Anything else I need to be aware of when submitting batches of statements?
I've only ever executed single statements at a time, but the format of the
file is such that I don't want to parse it statement by statement, and
besides both Oracle and SQL Server supports execution of batches of SQL
statements, and the SQL server version of the App is working perfecrtly.
-- This is a comment
-- This is another comment
CREATE TABLE grde_cbe (
-- This is a third comment