The easiest way to do this is to use PL/SQL and the 'execute immediate'
statement.

--
Ron Reidy
Lead DBA
Array BioPharma, Inc.

-----Original Message-----
From: Ready, Mike [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 19, 2006 8:58 AM
To: dbi-users@perl.org
Subject: Creating an oracle temp table with a variable table name

Hi
Is there a way to use a bind variable to pass a tablename into an oracle
create table statement - e.g. 
CREATE TABLE ? 
(
  CASE_NUM       NUMBER,
  TLM_PROG       VARCHAR2(50 BYTE),
  TLM_REASON     VARCHAR2(100 BYTE),
  TLM_CREATE_DT  DATE,
  TLM_TASK_NAME  VARCHAR2(50 BYTE),
  TLM_ACTION     VARCHAR2(50 BYTE)
)
 
where ? gets replaced with a bind variable holding a temp table name
that contains the date?  I can do it by substituting the date into the
sql string or by concatenating the tablename with a couple of strings to
create the sql statement, but it seems cheesy.  If I try to do it using
a bind variable, it errors out.
 
Thanks
Mike R.
 
Michael P. Ready
Texas ACCESS Alliance
Work 512-533-3959, Mobile 512-796-7085, Fax 512-437-6532
AIM: michaelpready
[EMAIL PROTECTED]
 

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is 
intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

Reply via email to