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

Home -> Community -> Usenet -> c.d.o.misc -> Please HELP !!!(It makes me crazy)

Please HELP !!!(It makes me crazy)

From: Mikhail <stiger_at_chat.ru>
Date: 1998/01/14
Message-ID: <34bcf4dc.12256143@news.gncom.com>#1/1

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. Received on Wed Jan 14 1998 - 00:00:00 CST

Original text of this message

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