Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > fetchall_arrayref failed since upgrading

Reply
Thread Tools

fetchall_arrayref failed since upgrading

 
 
Syl
Guest
Posts: n/a
 
      04-20-2006
Hi group - not sure if my error is coming from the database install,
or from the Perl DBI version

My script used to run perfectly on a Linux server with this config :
/usr/lib/perl5/5.6.0
PostgreSQL 7.1.3
DBI is version 1.20

The new server config is not accepting the fetchall_arrayref :
/usr/lib/perl5/5.8.5
PostgreSQL 8.1.0
DBI is version 1.40

This is my query :
$query="select distinct dossier,sdolink from table where dossier is
not null";
$sth = $dbh_std->prepare($query);
$sth->execute();
$data = $sth->fetchall_arrayref;
$sth->finish;

When I kick off the script from the command line, I am getting this
error :
DBD:g::st execute failed: ERROR: invalid input syntax for
integer: ""
DBD:g::st fetchall_arrayref failed: no statement executing

Any ideas ?

I'm at my wits end - and my boss is getting VERY anxious!

Thanks

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      04-20-2006
Syl wrote:
> Hi group - not sure if my error is coming from the database install,
> or from the Perl DBI version
>
> My script used to run perfectly on a Linux server with this config :
> /usr/lib/perl5/5.6.0
> PostgreSQL 7.1.3
> DBI is version 1.20
>
> The new server config is not accepting the fetchall_arrayref :
> /usr/lib/perl5/5.8.5
> PostgreSQL 8.1.0
> DBI is version 1.40
>
> This is my query :
> $query="select distinct dossier,sdolink from table where dossier is
> not null";
> $sth = $dbh_std->prepare($query);
> $sth->execute();
> $data = $sth->fetchall_arrayref;
> $sth->finish;
>
> When I kick off the script from the command line, I am getting this
> error :
> DBD:g::st execute failed: ERROR: invalid input syntax for
> integer: ""
> DBD:g::st fetchall_arrayref failed: no statement executing
>
> Any ideas ?


I do not believe you have a Perl problem. You have a PostgreSQL
problem. The execute error above is telling you that the database
itself refused to accept your query. The later fetchall_arrayref error
is simply telling you that you can't fetch anything because you don't
have any actively executing statement (because the execute failed).

I suggest contacting a PostgreSQL group to see if anything relevant
might have changed between versions 7.1.3 and 8.1.0

I would also recommend checking your data very carefully. I know
nothing about Pg, but it looks like it's telling you you've given a
blank string where it expects an integer...

Paul Lalli

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      04-20-2006
Paul Lalli wrote:
> I do not believe you have a Perl problem. You have a PostgreSQL
> problem.


> I suggest contacting a PostgreSQL group to see if anything relevant
> might have changed between versions 7.1.3 and 8.1.0


And only *after* I posted this did I notice that it was in fact going
to a PostgreSQL group as well as comp.lang.perl.misc. My apologies for
the faulty assumption.

Paul Lalli

 
Reply With Quote
 
Syl
Guest
Posts: n/a
 
      04-20-2006
Paul - THANK YOU for such a quick reply.

I suspected that at first.
Postgres seems to have changed the naming convention of the columns. In
version 7 the integer column is defined as : int4 while in 8.0 the
integer column simply states : integer
I built the new table using a structure dump of the old - and received
no errors.

Thanks you for helping me isolate the error - it obviously makes it
much easy to know what/where I should focusing on!

 
Reply With Quote
 
Ch Lamprecht
Guest
Posts: n/a
 
      04-20-2006
Syl wrote:
> Hi group - not sure if my error is coming from the database install,
> or from the Perl DBI version
>


>
> This is my query :
> $query="select distinct dossier,sdolink from table where dossier is
> not null";
> $sth = $dbh_std->prepare($query);
> $sth->execute();
> $data = $sth->fetchall_arrayref;
> $sth->finish;
>
> When I kick off the script from the command line, I am getting this
> error :
> DBD:g::st execute failed: ERROR: invalid input syntax for
> integer: ""
> DBD:g::st fetchall_arrayref failed: no statement executing
>
> Any ideas ?


Hi,
did you try to run the very same query from psql?

Christoph
--

perl -e "print scalar reverse q//"
 
Reply With Quote
 
Syl
Guest
Posts: n/a
 
      04-20-2006
Hi Christoph - The select syntax is correct. Yes - I didn run the query
from psql and received no errors.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not entering standby since upgrading to Service Pack 2 =?Utf-8?B?U2FsYWh1ZGRpbg==?= Windows 64bit 3 06-16-2007 02:07 PM
serialize array of references from $sth->fetchall_arrayref Filippo Perl Misc 2 02-19-2007 01:20 PM
memory release with fetchall_arrayref rkusenet Perl Misc 2 04-13-2006 05:46 AM
20 since 4.1 failed 70-270 Greg MCSA 7 05-09-2005 10:12 PM
fetchall_arrayref into bind_param_array Oliver G Perl Misc 5 11-13-2003 02:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57