Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to create table by store procedure in Oracle9i

Re: How to create table by store procedure in Oracle9i

From: andrewst <member14183_at_dbforums.com>
Date: Tue, 08 Jul 2003 10:44:59 +0000
Message-ID: <3085278.1057661099@dbforums.com>

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.com
Received on Tue Jul 08 2003 - 05:44:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US