Active statement error

2001-05-31 Thread Hèctor Alòs i Font

We have got the following error:

DBI::db=HASH(0xfa5dc)-disconnect invalidates 1 active
statement handle (either destroy statement handles or call
finish on them before disconnecting) at ...

We are quite amazed because we can not discover which
statement handle can be active: we just added a select
statement in the programme. (We are being programming with
DBI and DBD::Oracle for a least a couple of years)
Anyone has any idea, please?

By the way, where can we find the DBI error messages with an

explanation about them?
Thanks in advance.

Hèctor






Re: Active statement error

2001-05-31 Thread Michael A. Chase

The warning indicates that you have a statement handle that you have not
fetched from until it indicated there are no more rows.

You might try assigning undef to the new statement's handle when you are
finished with it.
--
Mac :})
** I normally forward private database questions to the DBI mail lists. **
Give a hobbit a fish and he'll eat fish for a day.
Give a hobbit a ring and he'll eat fish for an age.
- Original Message -
From: Hèctor Alòs i Font [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 31, 2001 04:06
Subject: Active statement error


 We have got the following error:

 DBI::db=HASH(0xfa5dc)-disconnect invalidates 1 active
 statement handle (either destroy statement handles or call
 finish on them before disconnecting) at ...

 We are quite amazed because we can not discover which
 statement handle can be active: we just added a select
 statement in the programme. (We are being programming with
 DBI and DBD::Oracle for a least a couple of years)
 Anyone has any idea, please?

 By the way, where can we find the DBI error messages with an

 explanation about them?
 Thanks in advance.

 Hèctor








Re: Active statement error

2001-05-31 Thread Orlando Andico

On Thu, 31 May 2001, [iso-8859-1] Hèctor Alòs i Font wrote:
..
 Simply something as simple as :
 
 $sth = $dbh-prepare (select FIELD from TABLE where
 IDENTIFIER=?);
 $sth-execute ('VALUE');
 ($field_value) = $sth-fetchrow_array;

Make sure to do an

$sth-finish;

before quitting. This will eliminate the warning.


-- 
Orlando Andico [EMAIL PROTECTED]
Mosaic Communications, Inc.

-BEGIN GEEK CODE BLOCK-
Version: 3.1
GE d(-) s: a-25 C UBLSI$ P+++ L+++ E- W++ N(+)
o K? w O-- M- !V PS(++) PE- Y PGP-- t(+)@ 5(+) X++@ R(+) tv@
b++ DI++ G e++@ h--(*) r% y+
--END GEEK CODE BLOCK--




RE: Active statement error

2001-05-31 Thread Neil Lunn

Unless fetchrow_array is in a loop that would imply to me that there are
more results to fetch. If it is in a loop, is it possible there is a loop
exit before all results are fetched?

-- Neil

 -Original Message-
 From: Hèctor Alòs i Font [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 31, 2001 9:27 PM
 To: Bart Lateur
 Cc: [EMAIL PROTECTED]
 Subject: Re: Active statement error
 
 
 Simply something as simple as :
 
 $sth = $dbh-prepare (select FIELD from TABLE where
 IDENTIFIER=?);
 $sth-execute ('VALUE');
 ($field_value) = $sth-fetchrow_array;
 
 
 En/Na Bart Lateur ha escrit:
 
  On Thu, 31 May 2001 13:06:26 +0200, Hèctor Alòs i Font wrote:
 
  DBI::db=HASH(0xfa5dc)-disconnect invalidates 1 active
  statement handle (either destroy statement handles or call
  finish on them before disconnecting) at ...
  
  We are quite amazed because we can not discover which
  statement handle can be active: we just added a select
  statement in the programme.
 
  What does this particular recent addition look like?
 
  --
  Bart.
 

__
Please Note :
Only  the intended recipient is authorised to access or use this e-mail.  If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately.   The contents
of this e-mail are the writer's 
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.

We use virus scanning software but exclude all liability for viruses or
similar in any attachment.





Re: Active statement error

2001-05-31 Thread Tim Bunce

On Thu, May 31, 2001 at 01:44:37PM +0200, Bart Lateur wrote:
 On Thu, 31 May 2001 19:29:12 +0800 (PHT), Orlando Andico wrote:
 
 On Thu, 31 May 2001, [iso-8859-1] Hèctor Alòs i Font wrote:
 ..
  Simply something as simple as :
  
  $sth = $dbh-prepare (select FIELD from TABLE where
  IDENTIFIER=?);
  $sth-execute ('VALUE');
  ($field_value) = $sth-fetchrow_array;
 
 Make sure to do an
 
 $sth-finish;
 
 before quitting. This will eliminate the warning.
 
 Indeed. The reason is that, even if *you* know there is only one record,
 but the DB doesn't know that, because it hasn't searched upto the end of
 the recordset, yet.
 
 If you were to repeat the $sth-fetchrow_array until it returned
 nothing, *then* the DB would know there is no more. Then the warning
 would disappear.
 
 But finish is a smarter way of just disregarding any pending results
 (even if there are none).

In this case using a

$field_value = $dbh-selectrow_array(..., undef, 'VALUE');

would be the best solution.

Tim.