Re:

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: "Mace, Richard" <richard(dot)mace(at)Lorien(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re:
Date: 2003-12-18 12:49:55
Message-ID: 1071751795.22842.1.camel@braydb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • at 2003-12-18 08:40:15 from Mace, Richard

Responses

  • Re: at 2003-12-18 15:04:53 from Tom Lane

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2003-12-18 14:53:21 Re:
Previous Message Mace, Richard 2003-12-18 08:40:15