Hi

Not sure why but Access via ODBC doesn't like double quotes in a query (not
on the two NT4 boxes I've used it on), see if the following helps 

$statement =qq{select description from t_system_symbols where
 name_space = 'COUNTRY' and value = ?};

Stu



> -----Original Message-----
> From: Brennan, Corey [mailto:[EMAIL PROTECTED]]
> Sent: 19 July 2001 18:32
> To: [EMAIL PROTECTED]
> Subject: prepare_cached statement error??? 
> 
> 
> Hi all,
> 
> I am having trouble getting a script ported over to NT from 
> Unix.  This
> syntax works on the Unix side but when I try it on NT I get 
> the following
> error:
> 
> DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft 
> Access Driver] Too
> few parameters. Expected 3. (SQL-07001)(DBD:st_execute/SQL
> Execute err=-1) at C:\Program 
> Files\ipc\pricing_tool\maxgen\ESR_PwrReport.pl
> line 257.
> select description from t_system_symbols where name_space = 
> "COUNTRY" and
> value = ? Error
> 
> The code looks like this:
>
>       $row = &get_sql_data($statement, $country_temp);
>       $country = $row->[0];
> 
> sub get_sql_data {
>       
>       my ($stmt, @parm) = @_;
>       
>       my $sth = $dbh->prepare_cached($stmt) or die ("$stmt\n");
>       $sth->execute(@parm) or die ("$stmt Error\n");
>       my $row = $sth->fetchrow_arrayref();
>       undef $sth;
>       
>       return $row;
> }
> 
> Any help would be greatly appreciated.
> 
> Thanks in advance
> ---
> Corey Brennan
> 

Reply via email to