[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Question about bind_param and Oracle
On Fri, Jul 16, 2004 at 11:57:05AM -0400, David N Murray wrote:
> You can't use a parameter for the table name. You have to use dynamic
sql
> (i.e. put it in the $sql var before the prepare). There
On Fri, Jul 16, 2004 at 11:57:05AM -0400, David N Murray wrote:
> You can't use a parameter for the table name. You have to use dynamic sql
> (i.e. put it in the $sql var before the prepare). There's no point in the
> prepare if the DB can't even figure out what table is going to be hit.
>
> Thi
bind_param( ) is meant to bind VALUES only. So one cannot bind
database objects/schema names/ column names etc. Table names, column
names etc
should be mentioned in $sql. Place holders take only values.
. . . .
my $sql = "Select count(*) from $schema_name.$table_name where
$column_name = ?";
. .
You can't use a parameter for the table name. You have to use dynamic sql
(i.e. put it in the $sql var before the prepare). There's no point in the
prepare if the DB can't even figure out what table is going to be hit.
This should be a FAQ, but I didn't see it in there.
hth,
dave
On Jul 16, [E
cc:
Subject: RE: Question about bind_param and Oracle
Are you logging on as the owner of the table? If not, you need to qualify
the table name.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, July 16, 2004 11:45 AM
To: [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 ?&quo
Are you logging on as the owner of the table? If not, you need to qualify the table
name.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, July 16, 2004 11:45 AM
To: [EMAIL PROTECTED]
Subject: Question about bind_param and Oracle
Hi all,
Hoping
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