$dbh->prepare is hanging

$dbh->prepare is hanging

am 28.08.2006 17:39:12 von Peter.Loo

------_=_NextPart_001_01C6CAB8.1D620B81
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Hi All,
=20
I am trying to execute a very simple SELECT statement through Perl DBI
and it is hanging. I have actually issues this very same command at the
SQL prompt and the output is immediately returned. I turned on the
debug mode and the program hangs at:
=20
DBD::ODBC::st::_prepare($sth, $statement, @attribs) or return undef;
=20
The SELECT statement is as follows:
=20
select ptnt_gid, prdct_gid, rx_fill_dte, claim_gid, ovrd_days_sply_nbr,
clfsn_grace_prd_nbr, 'N', (rx_fill_dte + ovrd_days_sply_nbr) from
p_dlvrb_rx_claim_extract where ptnt_gid =3D 337 and prdct_gid =3D 18607
order by ptnt_gid, prdct_gid, rx_fill_dte, claim_gid=20

main::(./step1.pl:73): $sth2 =3D $dbh->prepare($sqlString) || die
"$!\n";
DB<2> s
DBD::ODBC::db::prepare(/usr/local/lib/perl5/site_perl/5.8.6/ sun4-solaris
/DBD/ODBC.pm:90):
90: my($dbh, $statement, @attribs)=3D @_;
DB<2> s
DBD::ODBC::db::prepare(/usr/local/lib/perl5/site_perl/5.8.6/ sun4-solaris
/DBD/ODBC.pm:93):
93: my $sth =3D DBI::_new_sth($dbh, {
94: 'Statement' =3D> $statement,
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
247):
1247: my ($dbh, $attr, $imp_data) =3D @_;
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
248):
1248: my $imp_class =3D $dbh->{ImplementorClass}
1249: or Carp::croak("DBI _new_sth: $dbh has no
ImplementorClass");
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
250):
1250: substr($imp_class,-4,4) =3D '::st';
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
251):
1251: my $app_class =3D ref $dbh;
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
252):
1252: substr($app_class,-4,4) =3D '::st';
DB<2> s
DBI::_new_sth(/usr/local/lib/perl5/site_perl/5.8.6/sun4-sola ris/DBI.pm:1
253):
1253: _new_handle($app_class, $dbh, $attr, $imp_data, $imp_class);
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1161):
1161: my ($class, $parent, $attr, $imp_data, $imp_class) =3D @_;
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1163):
1163: Carp::croak('Usage: DBI::_new_handle'
1164: .'($class_name, parent_handle, \%attr,
$imp_data)'."\n"
1165: .'got: ('.join(", ",$class, $parent, $attr,
$imp_data).")\n")
1166: unless (@_ == 5 and (!$parent or ref $parent)
1167: and ref $attr eq 'HASH'
1168: and $imp_class);
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1170):
1170: $attr->{ImplementorClass} =3D $imp_class
1171: or Carp::croak("_new_handle($class): 'ImplementorClass'
attribute not given");
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1173):
1173: DBI->trace_msg(" New $class (for $imp_class,
parent=3D$parent, id=3D".($imp_data||'').")\n")
1174: if $DBI::dbi_debug >=3D 3;
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1177):
1177: my (%hash, $i, $h);
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1178):
1178: $i =3D tie %hash, $class, $attr; # ref to inner hash =
(for
driver)
DB<2> s
DBI::st::TIEHASH(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1188):
1188: sub DBI::st::TIEHASH { bless $_[1] =3D> $_[0] };
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1179):
1179: $h =3D bless \%hash, $class; # ref to outer hash =
(for
application)
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1182):
1182: DBI::_setup_handle($h, $imp_class, $parent, $imp_data);
DB<2> s
DBI::_new_handle(/usr/local/lib/perl5/site_perl/5.8.6/sun4-s olaris/DBI.p
m:1184):
1184: return $h unless wantarray;
DB<2> s
DBD::ODBC::db::prepare(/usr/local/lib/perl5/site_perl/5.8.6/ sun4-solaris
/DBD/ODBC.pm:101):
101: DBD::ODBC::st::_prepare($sth, $statement, @attribs)
102: or return undef;
DB<2> s
=20
Then when I break out, I get the following error:
=20
DBD::ODBC::db prepare failed: [unixODBC]Unexpected protocol character
(SQL-08S02)(DBD: st_prepare/SQLPrepare err=3D-1) at=20
=20
Hope someone can shed some light.
=20
Thanks.
=20
Peter

------_=_NextPart_001_01C6CAB8.1D620B81--