freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Michael Peppler <mpeppler AT bluewin.ch>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Odd statement execution problem
- Date: Tue, 24 Jun 2003 14:35:34 -0000
On Mon, 2003-06-23 at 18:53, Will Saxon wrote:
> Hello,
>
> I have a perl script that is using DBD::Sybase 1.00 and DBI 1.47. I am
> using FreeTDS 0.61 on a FreeBSD 4.8-STABLE machine with Perl 5.8.0. All of
> the above are compiled from ports.
>
> This script has one section where the code is similar to this:
>
> unless ($hash{"key"}) {
> my $sql = "select value from table where field1 = '$variable' order by
> field2 desc";
> @array = $dbh->selectrow_array($sql);
> $hash{"key"} = $array[0];
>
> Occasionally, select statements are failing with an error like this:
>
> Can't call method "selectrow_array" on an undefined value at ./script
> line ##.
This means that $dbh isn't defined - i.e. you don't actually have an
open connection at this point.
BTW - don't change "my $sql = ..." to "local $sql = ..." - I very much
doubt that you need the "local" semantics here.
Michael
-
[freetds] Odd statement execution problem,
Will Saxon, 06/23/2003
- Re: [freetds] Odd statement execution problem, Michael Peppler, 06/24/2003
- <Possible follow-up(s)>
- RE: [freetds] Odd statement execution problem, Lowden, James K, 06/23/2003
- RE: [freetds] Odd statement execution problem, Will Saxon, 06/23/2003
- RE: [freetds] Odd statement execution problem, Will Saxon, 06/24/2003
Archive powered by MHonArc 2.6.24.