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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Dinamic PL/SQL.

Re: Dinamic PL/SQL.

From: Charles Dye PC <cdye_at_DNT.DIALOG.COM>
Date: Tue, 5 Mar 1996 11:49:22 -0500
Message-Id: <9603041712.AA06717@alice.jcc.com>


Maria,

The basic idea is something like this:

CREATE OR REPLACE PROCEDURE MakeTable( pTableName IN VARCHAR) AS

        hCursor INTEGER;
        rows    INTEGER;
BEGIN
        hCursor := dbms_sql.open_cursor;
        dbms_sql.parse( hCursor,
                        'CREATE TABLE ' || pTableName || 'col1 NUMBER(1) )',
                        dbms_sql.v7);

        ----------------------------------------------------------------
        -- For Non-DDL ops, you need to explicitely execute the cursor
        -- like this:
        -- rows := dbms_sql.execute( hCursor )
        -- You don't need to do this for DDL such as CREATE TABLE
        ----------------------------------------------------------------

        dbms_sql.close_cursor(hCursor);
END; Remember not to put a semicolon (";") at the end of you statement in the  dbms_sql.parse call -- I think everybody makes this mistake at least once.

HTH. Regards,
Charles_Dye_at_corp.dialog.com

> From owner-oracle-l_at_CCVM.SUNYSB.EDU Tue Mar 5 04:49:35 1996
> Date: Mon, 4 Mar 1996 07:47:34 -0500
> From: Maria del Pilar Villamil Giraldo <m-villam_at_UNIANDES.EDU.CO>
> Subject: Dinamic PL/SQL.
> X-To: "ORACLE database mailing list." <ORACLE-L_at_ccvm.sunysb.edu>
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_ccvm.sunysb.edu>
>
> Hi,
> I can execute using Dinamic PL/SQL. commands how:
> Create Table????
> in general commands of DDL??
>
> if I can, how is the process to this???
>
> Thank you
>
Received on Mon Mar 04 1996 - 12:12:27 CST

Original text of this message

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