Re: - Mailing list pgsql-novice

From Oliver Elphick
Subject Re:
Date
Msg-id 1071751795.22842.1.camel@braydb
Whole thread Raw
In response to  ("Mace, Richard" <richard.mace@Lorien.co.uk>)
Responses Re:
List pgsql-novice
On Thu, 2003-12-18 at 08:40, Mace, Richard wrote:
>
> $sth = $dbh->prepare("SELECT telephone from sample");
> $sth->execute();
> $sth->bind_columns(undef, \$telephone);
> while ( $sth->fetch ) {
>     print STDERR "$telephone\n";
> }
> $sth->finish;
>
> This fails with "Statement has no result to bind(perhaps you need to
> call execute first)"
>
> This code works fine for a field that is always populated e.g. name in
> place of telephone in line 1.

If a cell is NULL, I think it is undefined in DBI

Try changing your select to

  SELECT telephone from sample WHERE telephone IS NOT NULL


pgsql-novice by date:

Previous
From: "Mace, Richard"
Date:
Subject:
Next
From: Michael Fuhr
Date:
Subject: Re: