Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: dynamic DML statements in stored procedures
>>How is this possible as you never call dbms_sql.execute?
DDL statements are executed immediately when parsed. DML and SQL
statements, as well as dynamic PL/SQL, must be parsed and executed.
--
- Dan Clamage
http://www.telerama.com/~dclamage
If you haven't crashed the Server,
you haven't been trying hard enough.
Paul Yee <yobble_at_ihug.co.nz> wrote in article
<1dbmp8d.1bu2awfwomoceN_at_p45-max8.wlg.ihug.co.nz>...
> ...
>
> > >-- create or replace procedure ptest
> > >-- as
> > >declare
> > > TblStatement varchar2(32000);
> > > c integer ;
> > >begin
> > > TblStatement := 'CREATE TABLE TTEST (CTEST VARCHAR2(30))' ;
> > > c := dbms_sql.open_cursor;
> > > dbms_sql.parse(c, TblStatement, dbms_sql.v7) ;
> > > dbms_sql.close_cursor(c);
> > >end ;
> > >/
> > >
> > >and I run it as an anoymous PL/SQL block, it works !
> > >
> > >SQL> start ptest
> > >
> > >PL/SQL procedure successfully completed.
> > >
> > >SQL> desc ttest
> > > Name Null? Type
> > > ------------------------------- -------- ----
> > > CTEST VARCHAR2(30)
> > >
>
> How is this possible as you never call dbms_sql.execute?
>
> Paul
>
>
Received on Fri Jul 03 1998 - 14:35:05 CDT
![]() |
![]() |