On Tue, 9 Sep 2003 12:50:07 -0400  "Sharma, Amit"
<[EMAIL PROTECTED]> wrote:

> While trying to execute the following SQL , I get the following
> error:
> Can't call method "execute" on an undefined value at x.pl line 105.
> ..
> my $sqlSch = "SELECT SEQ_NO from $TableName";
> my $sth = $dbHandle->prepare($sqlSch);
> $sth->execute();
> $sth->bind_columns(undef, \$SequenceNum);

The prepare() failed and you haven't the foggiest notion of what
happened since you aren't checking for errors.  You should either set
$dbHandle -> {RaiseError} or check for errors on each method call.

   # Either enable implicit error checking
   $dbHandle -> {RaiseError} = 1;

   # Or check for errors each method call
   my $sqlSch = "SELECT SEQ_NO from $TableName";
   my $sth = $dbHandle->prepare($sqlSch)
      or die "Prepare failed, $DBI::errstr\n$sqlSch\n";
   $sth->execute() or die "Execute failed, $DBI::errstr\n";

-- 
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to