RE: Question about bind_param and Oracle

2004-07-16 Thread HSIA, GEORGE (SBCSI)
[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&#

Re: Question about bind_param and Oracle

2004-07-16 Thread Tim Bunce
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

Re: Question about bind_param and Oracle

2004-07-16 Thread Ravi Kongara
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 = ?"; . .

Re: Question about bind_param and Oracle

2004-07-16 Thread David N Murray
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

RE: Question about bind_param and Oracle

2004-07-16 Thread alsalvo
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

RE: Question about bind_param and Oracle

2004-07-16 Thread Reidy, Ron
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

RE: Question about bind_param and Oracle

2004-07-16 Thread Helck, Timothy
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

Question about bind_param and Oracle

2004-07-16 Thread alsalvo
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