FAQ
I'm using mod_perl and Informix, and therefore Apache::DBI and DBD::Informix

It seems I am running into stale database handles

That is to say a connect in my code 'works' but any operation on the dbh
fails with a

can't call method 'blah' on an undefined value

after a time.



Reading http://search.cpan.org/~phred/Apache-DBI-1.10/lib/Apache/DBI.pm

suggests that I need a dbping method and an example is supplied

What 'simple' piece of sql do the team suggest?

select 1 from systables where tabid =1

for example?

TIA

--
Clive

Search Discussions

  • John R Pierce at Sep 1, 2011 at 9:17 am

    On 09/01/11 2:10 AM, Clive Eisen wrote:
    What 'simple' piece of sql do the team suggest?

    select 1 from systables where tabid =1
    why not just SELECT TRUE; ?



    --
    john r pierce N 37, W 122
    santa cruz ca mid-left coast
  • Clive Eisen at Sep 1, 2011 at 11:10 am

    On 01/09/2011 12:16, John R Pierce wrote:
    On 09/01/11 2:10 AM, Clive Eisen wrote:

    What 'simple' piece of sql do the team suggest?

    select 1 from systables where tabid =1
    why not just SELECT TRUE; ?

    because that is not valid sql unless you are using a toy database
  • Jonathan Leffler at Sep 1, 2011 at 2:55 pm

    On Thu, Sep 1, 2011 at 02:10, Clive Eisen wrote:

    I'm using mod_perl and Informix, and therefore Apache::DBI and
    DBD::Informix
    It seems I am running into stale database handles
    That is to say a connect in my code 'works' but any operation on the dbh
    fails with a
    can't call method 'blah' on an undefined value
    after a time.

    Reading http://search.cpan.org/~phred/**Apache-DBI-1.10/lib/Apache/**
    DBI.pm <http://search.cpan.org/%7Ephred/Apache-DBI-1.10/lib/Apache/DBI.pm>

    suggests that I need a dbping method and an example is supplied
    What 'simple' piece of sql do the team suggest?
    select 1 from systables where tabid =1
    That is the simplest one that works in (almost) any Informix database. To
    be safe against 'MODE ANSI' databases, you'd use:

    SELECT 1 FROM "informix".systables WHERE TabID = 1

    This is safe in a MODE ANSI databases, and any version from 4.00 onwards.

    --
    Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
    Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
    "Blessed are we who can laugh at ourselves, for we shall never cease to be
    amused."

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedSep 1, '11 at 9:10a
activeSep 1, '11 at 2:55p
posts4
users3
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase