SQL>
SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
2 AUTHID CURRENT_USER
3 IS
4 BEGIN
5 EXECUTE IMMEDIATE ddl_in;
6 END;
7 /
Procedure created.
SQL>
SQL> CREATE OR REPLACE PROCEDURE creindx(index_in IN VARCHAR2, tab_in IN VARCHAR2, col_in IN VARCHAR2)
2 IS
3 DDL_statement VARCHAR2(200):= 'CREATE INDEX ' || index_in || ' ON ' || tab_in ||' ( ' || col_in || ')';
4 BEGIN
5 runddl (DDL_statement);
6 END;
7 /
Procedure created.
SQL>