Looks like it's parts of the script that execute stored procedures ...

This works fine

$dbh = DBI->connect("dbi:Sybase:database=xxxxxxxxxxx", "xxxxxxxx",
"xxxxxxxxxxxxx");

$sql = <<_ENDSQL;
SELECT Customers.CustomerID, Plans.PlanID, Emails.PopName,
Emails.EmailAddress, Emails.Password
FROM Plans INNER JOIN Customers ON Plans.CustomerID = Customers.CustomerID
INNER JOIN Emails ON Plans.PlanID = Emails.PlanID
WHERE Emails.PopName="$userid" AND Emails.EmailAddress="$address" AND
Emails.Password="$pass"
_ENDSQL

$sth = $dbh->prepare($sql);
$sth->execute;

while (@detail = $sth->fetchrow_array) {
        $custid = $detail[0];
        $emailid = $detail[1];
        $popname = $detail[2];
        $address = $detail[3];
        $password = $detail[4];
        $realname = $detail[5];

        print "Custid  :  $custid\n";
        print "EmailId :  $emailid\n";
        print "address :  $address\n";
        print "Popname :  $popname\n";
        print "Password:  $password\n";
        print "Today   :  $today\n";
}

$dbh->trace(9);
$dbh->disconnect || print "$DBI::errstr  $DBI::err\n";


This Fails (hangs)...

$exec = qq{ Exec Subscribe_InsertPlan $custid,136,6,11,"$today"};

$sth2 = $dbh->prepare($exec);
$sth2->execute;


----- Original Message -----
From: "Curt Russell Crandall" <[EMAIL PROTECTED]>
To: "Jamie Orzechowski" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, April 06, 2001 2:26 PM
Subject: Re: Script Hangs when executing ...


> If Perl DBI is saying it can't find disconnect, then I would think either
> $dbh somehow gets undef'd or maybe your disconnect method is
> missing.  I've run into this before where my disconnect method was
> "missing".  It may be you just need to reinstall DBI, which is what my
> sysadmin did.  Why disconnect was missing... who knows???  It may also be
> that we needed to reinstall the DBD::Sybase driver and possibly the db
> client libraries... it was a while ago and I do not remember.
>
> Is that the WHOLE script or just the section that deals with the db?
>
> On Fri, 6 Apr 2001, Jamie Orzechowski wrote:
>
> > I tried sthX->finish and I get the same hangs ...
> >
> > I am split the script into seperate scripts and I run each part manually
...
> >
> > Even with the following script I get a hang ... if I insert sth->finish;
> > then the script will hang ... If I remove it then script will run but I
get
> > the error
> >
> > DBI::db=HASH(0x80efd18) trace level set to 9 in DBI 1.14-nothread
> > Can't locate object method "disconnect" via package "DBI::st" at ./test
line
> > 34.
> > -> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x80efd18)~INNER)
> > syb_db_disconnect() -> ct_close()
> > <- DESTROY= undef during global destruction.
> >
> > #---------------------------------
> > #script
> >
> > $dbh = DBI->connect("dbi:Sybase:database=xxxxxxxxxx", "xxxxx",
"xxxxxxxx");
> >
> > $sql = <<_ENDSQL;
> > Exec Subscribe_InsertPlan 13200,136,6,11,"$today"
> > _ENDSQL
> >
> > $sth = $dbh->prepare($sql);
> > $sth->execute || warn $sth->errstr;
> > $dbh->trace(9);
> > $dbh->disconnect;
> >
> > ----- Original Message -----
> > From: "Hans Foght" <[EMAIL PROTECTED]>
> > To: "'Thomas A. Lowery'" <[EMAIL PROTECTED]>; "Jamie Orzechowski"
> > <[EMAIL PROTECTED]>
> > Cc: "DBI-Users" <[EMAIL PROTECTED]>
> > Sent: Friday, April 06, 2001 1:22 PM
> > Subject: RE: Script Hangs when executing ...
> >
> >
> > > try $sthX->finish after execute when you do not need the $sthX
anymore.
> > >
> > > -----Original Message-----
> > > From: Thomas A. Lowery [mailto:[EMAIL PROTECTED]]
> > > Sent: 6. april 2001 19:25
> > > To: Jamie Orzechowski
> > > Cc: DBI-Users
> > > Subject: Re: Script Hangs when executing ...
> > >
> > >
> > > Still just hangs after the last destory?  (Also, keep the dbi-users
> > > mail list in the replies, the Sybase gurus are there.)
> > >
> > > Tom
> > >
> > > On Fri, Apr 06, 2001 at 01:03:52PM -0400, Jamie Orzechowski wrote:
> > > > with tace 9 I get
> > > >
> > > > DBI::db=HASH(0x80efd9c) trace level set to 9 in DBI 1.14-nothread
> > > > -> disconnect for DBD::Sybase::db
(DBI::db=HASH(0x80efdc0)~0x80efd9c)
> > > > DBI::db=HASH(0x80efd9c)->disconnect invalidates 3 active statement
> > handles
> > > > (either destroy statement handles or call finish on them before
> > > > disconnecting) at ./addplan line 107.
> > > > syb_db_disconnect() -> ct_close()
> > > > <- disconnect= 1 at ./addplan line 107.
> > > > -> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x80efd9c)~INNER)
> > > > <- DESTROY= undef during global destruction.
> > > >
> > > > any ideas??
> > > >
> > > > ----- Original Message -----
> > > > From: "Thomas A. Lowery" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Friday, April 06, 2001 12:55 PM
> > > > Subject: Re: Script Hangs when executing ...
> > > >
> > > >
> > > > > What does trace say?  ($dbh->trace(1-9) just before the
disconnect).
> > > > >
> > > > > Tom
> > > > >
> > > > > On Fri, Apr 06, 2001 at 12:25:51PM -0400, Jamie Orzechowski wrote:
> > > > > > Hello ... I have a script which connected to a MS SQL database
...
> > it
> > > > hangs
> > > > > > right at the end of the script ... if I check my database it
DOES
> > > insert
> > > > all
> > > > > > the information correctly ... it just hangs and never exits ...
any
> > > > ideas??
> > > > > >
> > > > > ... snip
> > > > > > $sth6 = $dbh->prepare($exec6);
> > > > > > $sth6->execute || warn $sth6->errstr;
> > > > >
> > > > > $dbh->trace(3);
> > > > >
> > > > > > $dbh->disconnect || print "$DBI::errstr  $DBI::err\n";
> > >
> > > _________________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.com address at http://mail.yahoo.com
> > >
> >
> >
> >
> >
>

Reply via email to