Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to create table by store procedure in Oracle9i
Originally posted by Southvn
> Hi All !
>
> How to create table by store procedure in Oracle9i ?
>
> Please help me !
>
>
>
> CREATE OR REPLACE procedure New_myproc IS
>
> VT_Statement varchar2(1000):='CREATE TABLE ATest (USERID NUMBER
> (14),MAKH VARCHAR2 (15),SOMAY VARCHAR2 (9),DVUID VARCHAR2 (15),TIEN
> NUMBER (14,2),KYHIEUDVU VARCHAR2 (15))';
>
> VT_cursor integer;
> VT_exe integer;
>
> begin
>
> VT_cursor:= dbms_sql.OPEN_CURSOR;
> dbms_sql.PARSE(VT_cursor,VT_Statement,2);
> VT_exe:= dbms_sql.EXECUTE(VT_cursor);
> dbms_sql.CLOSE_CURSOR(VT_cursor);
>
> END;
>
> This store had one error, but I can't find it.
> Please help me !
> Thanks you very much
You don't say what the error is (always useful information!), but I'll
hazard a guess it is this:
ORA-01031: insufficient privileges
This means that the owner of the procedure has not been granted CREATE TABLE privilege DIRECTLY (not via a role). Procedures require DIRECT priviliges.
-- Posted via http://dbforums.comReceived on Tue Jul 08 2003 - 05:44:59 CDT
![]() |
![]() |