Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DDL Parsing Code for VB?

Re: DDL Parsing Code for VB?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Thu, 30 Jan 2003 11:12:46 +0000
Message-ID: <b1aqb0$a1g$1@ctb-nnrp2.saix.net>


Steve S wrote:

> I am using 8.1.7.0.0 Standard Edition, ODBC Driver 8.1.77.0
>
> I guess the underlying question is;
> Is there a way to run a multi-statement DDL script using pass-through
> queries from Access?
>
> Every method I try errors out if there is more than one statement
> ending with a ';' or a '/'.

Using those terminators are SQL*Plus syntax - i.e. is used by SQL*Plus to determine the start and end of SQL statements.

These separators are illegal in a SQL statement - when passed to Oracle, you will get a [ORA-00911: invalid character].

Oracle does allow multiple statements in a single "transmission". It's called an anonymous PL/SQL block. Something like this:

mySQLstatement = 'BEGIN' +
                 '   EXECUTE IMMEDIATE blah blah ;' +
                 '   EXECUTE IMMEDIATE blah blah ;' +
                 'END;'

Then you pass that string to your SQL passthru function to Oracle.

However.. it makes more sense to rather implement this a regular PL/SQL stored proc. Limit the SQL bandwidth generated by the client. Limit the amount of database administration stuff in the client and put that where it should be - in the database.

--
Billy
Received on Thu Jan 30 2003 - 05:12:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US