FAQ
Gooday fine people?

Has anyone here successfully managed to get SQL DECODE to
work with perl DBI using Oracle as a db backend. I keep
getting the same error continously...
"$h-<rows count is incomplete before all rows fetched"
Whether this result from the use of DECODE or not I don't
know....but it seems DECODE does not work at all...can
anyone vouch for this?

Now, I read a bit bout this, and in the DBI draft it states
that row count may be incomplete due to oracle's read-ahead
cache...*hmm*

Anyone can explain that to me, or possibly provide a
working example of how to cure this, and possibly a working
eg. of use of DECODE within perl DBI :)

Much appreciated



==
Download ringtones, logos and picture messages at Ananzi Mobile Fun.
http://www.ananzi.co.za/cgi-bin/goto.pl?mobile

Search Discussions

  • Michael A Chase at Jun 9, 2003 at 10:00 am

    On Mon, 09 Jun 2003 09:30:48 +0200 deadtwoU wishUknew wrote:

    Has anyone here successfully managed to get SQL DECODE to
    work with perl DBI using Oracle as a db backend. I keep
    getting the same error continously...
    "$h-<rows count is incomplete before all rows fetched"
    Whether this result from the use of DECODE or not I don't
    know....but it seems DECODE does not work at all...can
    anyone vouch for this?
    DECODE() works fine with DBI. It does, however, often add one or
    several levels of commas and parenthesis which you will have to be
    very careful balancing.
    Now, I read a bit bout this, and in the DBI draft it states
    that row count may be incomplete due to oracle's read-ahead
    cache...*hmm*
    That is exactly true. For a variety of reasons, rows() can not be
    trusted until after *ALL* rows have been processed or fetched.
    Anyone can explain that to me, or possibly provide a
    working example of how to cure this, and possibly a working
    eg. of use of DECODE within perl DBI :)
    Without seeing the exact SQL and the relevant parts of the script that
    uses it, only random guesses are possible. Please use cut and paste
    from the original script to be certain we don't just see your typos.

    Send the information to the list, not to me personally.

    --
    Mac :})
    ** I normally forward private questions to the appropriate mail list. **
    Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
    Give a hobbit a fish and he eats fish for a day.
    Give a hobbit a ring and he eats fish for an age.
  • Ronald J Kimball at Jun 9, 2003 at 2:27 pm

    On Mon, Jun 09, 2003 at 09:30:48AM +0200, deadtwoU wishUknew wrote:
    Gooday fine people?

    Has anyone here successfully managed to get SQL DECODE to
    work with perl DBI using Oracle as a db backend. I keep
    getting the same error continously...
    "$h-<rows count is incomplete before all rows fetched"
    Whether this result from the use of DECODE or not I don't
    know....but it seems DECODE does not work at all...can
    anyone vouch for this?
    You seem to have this unwavering superstition about DECODE. I guarantee
    you, there are no problems using DECODE through DBI. Any problems you are
    experiencing are unrelated to DECODE.

    DBI doesn't even care about DECODE. It passes off some SQL to Oracle, and
    gets some results back. DBI has to deal with placeholders, but other than
    that, it does not matter to DBI what is in the SQL.

    Now, I read a bit bout this, and in the DBI draft it states
    that row count may be incomplete due to oracle's read-ahead
    cache...*hmm*

    Anyone can explain that to me,
    Oracle doesn't know how many rows it will find until it has returned them
    all, because it can start returning rows before it has found them all.

    or possibly provide a working example of how to cure this, and possibly a
    working eg. of use of DECODE within perl DBI :)
    This will select myid and mycol from mytable, and when mycol is NULL, it
    will return '?' instead of undef:

    $sth->prepare(<<"EndOfSQL");
    SELECT myid, DECODE(mycol, NULL, '?', mycol)
    FROM mytable
    EndOfSQL


    Ronald

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedJun 9, '03 at 7:36a
activeJun 9, '03 at 2:27p
posts3
users3
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase