Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please HELP !!!(It makes me crazy)
>Subject: Please HELP !!!(It makes me crazy)
>From: stiger_at_chat.ru (Mikhail)
>Date: 1/14/98 5:59PM GMT
>Message-id: <34bcf4dc.12256143_at_news.gncom.com>
>
>Hello, everyone,
>I try create a storage procedure that produces a table_name and
>creates a table with this table_name in run time.
>I use
>…
>table_name VARCHAR2(6);
>command_run VARCHAR2(200);
>BEGIN
>…
>cursor_name:= DBMS_SQL.OPEN_CURSOR;
>command_run:=’CREATE TABLE ‘ || table_name || ‘ AS SELECT * FROM emp’;
>DBMS_SQL.PARSE(cursor_name, command_run, DBMS_SQL.V7);
>row_processed:= DBMS_SQL.EXECUTE(cursor_name);
>DBMS_SQL.CLOSE_CURSOR(cursor_name);
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>It does not work.
>But, if I use
>command_run=’DROP TABLE ‘|| table_name ||;
>-- where table_name is an existing table, it works!.
>If you have had a similar problem, please drop me mail.
>Thank you for your time.
>Mike.
>
>
>
>
>
>
>
Is it reporting an error message, could you let us know. It is quite possible that it is permissions related, since code executed in stored procedures relies on specifically granted privileges (e.g. CREATE TABLE) and not those available through a role (e.g. DBA) Received on Wed Jan 14 1998 - 00:00:00 CST