You cannot do this.  Bind params are not usable for tables.  You could use a PL/SQL 
block and execute immediate in PL/SQL, but that may not be what you are asking.

-----------------
Ron Reidy
Senior DBA
Array BioPharma, Inc.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, July 16, 2004 9:45 AM
To: [EMAIL PROTECTED]
Subject: Question about bind_param and Oracle


Hi all,

Hoping someone can help me out here.

I'm trying to do the following using Oracle 9i and DBI:

$table_name = "USERS";

$sql = "SELECT COUNT(*) FROM ?";

$sth = $dbh->prepare($sql);

$sth->bind_param(1,$table_name);

$sth->execute;
.
.
.
However, I'm getting an error about an invalid table name (I have verified 
that the table is valid and that I spelled it correctly). 

Is this even possible with Oracle and DBI?

Please let me know.

Thanks.

Aaron Salvo

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