DDL commands in PL/SQL

DDL commands in PL/SQL

Post by Programmin » Wed, 04 Jun 1997 04:00:00



Does anyone know how to execute DDL
commands in PL/SQL?

I am trying to use a stored procedure to
delete all the constraints on a temporary
table.  I have function to return the
constraint_name.  Now, I want to:

ALTER TABLE table_name
DROP CONSTRAINT constraint_name

However, since I am using a DDL command
(ie.  like create table) instead of a
DML command (ie. Select, Insert, Update),
the procedure won't execute.

Is there a way to do DML commands in some kind
of procedure or script?

Is there another way to do the intended result?  

Rodger Lepinsky
ADP Systems Partnership

 
 
 

DDL commands in PL/SQL

Post by Konstantin V Sartako » Thu, 05 Jun 1997 04:00:00



> Does anyone know how to execute DDL
> commands in PL/SQL?

> I am trying to use a stored procedure to
> delete all the constraints on a temporary
> table.  I have function to return the
> constraint_name.  Now, I want to:

> ALTER TABLE table_name
> DROP CONSTRAINT constraint_name

> However, since I am using a DDL command
> (ie.  like create table) instead of a
> DML command (ie. Select, Insert, Update),
> the procedure won't execute.

> Is there a way to do DML commands in some kind
> of procedure or script?

> Is there another way to do the intended result?

        Use DBMS_SQL package

Regards
-------------------------------
         Konstantin V. Sartakov
                Kuzbassprombank
                       Kemerovo
                         Russia


 
 
 

1. Using DDL commands in PL/SQL

 Through dbms_sql (in PL/SQL) I manage to use DDL commands, which is very
nice. Problem is I don't manage all of them. Drop Table works fine, but
when I try to Create Table it complaints about insufficient priviliges.
Well, I found that somewhat hard to believe, since the user woning
and running the PL/SQL package is granted the DBA role.

 Any idea?

/Mikael

2. Erland Sommarskog ....

3. SQL-DDL commands through ADO

4. Problems connecting to SQL Server through ODBC and DUN

5. DDL operations in PL/SQL

6. Looking for a SQL Server 7.0 expert

7. GA-Peachtree City-113039--ORACLE-Developer 2000-PL/SQL-Stored Procedures-DDL-UNI

8. SQLCTR70 error

9. DDL-statement in PL/SQL block

10. DDL in PL/SQL

11. PL/SQL and DDL

12. q: sync pl/sql and dynamic ddl statement ?