Hi Gurus,
I am trying to connect to SQL from Solaris using DBD::ProxyServer.
This script ask the user for Bug Fix number ($bfn). Then, it passes
this variable to check the SQL for existence.
Any help/ideas would be very much appreciated.
Thanks,
Murali
Here is the error:
DBD::Proxy::st execute failed: Server returned error: Failed to execute
method CallMethod:
DBD::ODBC::db prepare failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1: Incorrect
syntax near 'bfn'. (SQL-37000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be
prepared. (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1) at
D:/Perl/site/lib/DBI/ProxyServer.pm line 268.
Can't locate object method "disconnect" via package "DBI::st" (perhaps you
forgot to load "DBI::st"?) at trig2.pl line 21.
Here is the perl script:
#use strict;
use DBI;
use Data::Dumper;
$dsn = "dbi:ODBC:batman";
$proxy = "hostname=dolly1;port=1234";
$dbh = DBI->connect ("dbi:Proxy:$proxy;dsn=$dsn", 'reports',
'reports');
my $bfn = clearprompt(qw(text -pref -prompt), 'Enter the Bug-fix
Number');
my $sth = $dbh->prepare( 'SELECT k_productreview FROM
b_productreview where
k_productreview = $bfn');
$sth->execute;
while( $row = $sth->fetchrow_hashref ) {
print Dumper($row);
}
$sth->finish;
$dbh->disconnect;