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: can't create table in SQL script?

Re: can't create table in SQL script?

From: M. Bhatti <mohammed.bhatti_at_mci.com>
Date: Mon, 19 Oct 1998 10:04:36 -0400
Message-ID: <362B46F4.460AA443@mci.com>


MGokman wrote:

> Your SQL script has PL/SQL block where youre trying to create a table.
> DDL is
> not allowed in PL/SQL.

Not directly...but try this:

CREATE OR REPLACE PROCEDURE sp_ExecuteDDL (sSQL IN VARCHAR2) AS

   intCursor INTEGER;
   intReturn INTEGER;
BEGIN
   intCursor := dbms_sql.open_cursor;
   dbms_sql.parse(intCursor, sSQL, dbms_sql.v7);    intReturn := dbms_sql.execute(intCursor);    dbms_sql.close_cursor(intCursor);
END;
/

Where sSQL is any SQL statement that needs to be executed including DDL, DML. mkb Received on Mon Oct 19 1998 - 09:04:36 CDT

Original text of this message

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