Error creating table using plsql procedure

When I used the create statement with the body in the plsql procedure, I get the error message PLS-00103 encountered creating a character while waiting for one of the following ... Can someone tell me what is the reason and solution for this.

+3
source share
1 answer

In PL / SQL, you cannot directly use the DDL statement. You can either

  • Usage:
    EXECUTE IMMEDIATE 'CREATE ' || 'your command'as a string.

  • use the SYS.DBMS_SQL system package.
     curs := dbms_sql.open_cursor
     dbms_sql.parse ( curs, 'create ...' )
     dbms_sql.execute ( curs )
     dbms_sql.close_cursor ( curs )

  • use SYS.DBMS_DDL if you want to create a wrapped procedure.

+5
source

All Articles