Re: how to create table using stored procedure?

From: Markus Schwabe <mschwabe_at_gscout.de>
Date: 2000/05/19
Message-ID: <8g33oo$62q$1_at_news4.muc.eurocyber.net>#1/1


No, as Mr. Bakker wrote, only

  1. DBMS_SQL in Oracle 7 and 8
  2. Oracle 8i and above gives you the statement "execute immediate", like

    BEGIN
       Execute_Immediate ('CREATE TABLE blablabla');     END; 3) Of course you can write a C-Program with something like

    EXEC SQL
         EXECUTE IMMEDIATE 'DELETE FROM EMP WHERE EMPNO = 9460'     END-EXEC.     and call it via the extproc_connection - Feature from your Strored Procedure

    but what a complicated manner...

Markus

lkw <lkw_at_axiomatique.com> schrieb in im Newsbeitrag: 8g30he$6ao$1_at_mawar.singnet.com.sg...
> thanks ...
> just curious, apart from using dbms_sql package,
> any other way to support DDL inside Stored Procedures?
>
> Peter Falson <pfalson_at_mail.com> wrote in message
> news:8F39B2A69pfa_at_192.168.100.133...
> > lkw_at_axiomatique.com (lkw) wrote in
 <8g2is8$l51$1_at_clematis.singnet.com.sg>:
> >
> > >Hi All,
> > >
> > >One stricky quetion:
> > >How to run a DDL commnand inside Stored Procedure?
> > >like create table .... ??
> > >
> > >Your helps would be greatly apprecitated.
> > >
> > >lkw.
> > >
> > >
> >
> > I use a standard procedure called ANYDDL:
> >
> > procedure anyddl (s1 varchar2) as
> > cursor1 integer;
> > begin
> > cursor1 := dbms_sql.open_cursor;
> > dbms_sql.parse(cursor1, s1, dbms_sql.v7);
> > dbms_sql.close_cursor(cursor1);
> > end;
> >
> > Then in any other procedure:
> >
> > BEGIN
> > ANYDDL('CREATE TABLE bla bla bla');
> > END;
>
>
Received on Fri May 19 2000 - 00:00:00 CEST

Original text of this message