FAQ
In PL/SQL, if I need to know if I've fetched the last
row, I can do this:
IF recCursor%NOTFOUND THEN

...
...
END IF;

How would I do this in Perl? Looking at the DBI docs,
there does not seem to be a similar method. It
suggests doing a COUNT(*) or possibly use the
following:
$hash_ref = $sth->fetchall_hashref('id');

So, any similar functionality to %NOTFOUND in Perl?

tia

mkb

Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: mohammed bhatti
INET: mkb125_at_yahoo.com

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------

To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).

Search Discussions

  • Jared Still at Oct 3, 2001 at 4:07 am
    I suggest you join the Perl DBI list:

    http://lists.perl.org/showlist.cgi?name=dbi-users

    Perl::DBI works a little differently, it returns undef
    when the last row is retrieved.

    Here's a snippet:

    while ( @array = $sth->fetchrow ) {

    print q{'} . join(q{','}, @array) . q{'} . "\n";
    }

    When $sth->fetchrow returns undef, the loop is complete.

    BTW, the above one liner dumps a table to CSV format.

    Jared
    On Tuesday 02 October 2001 12:30, mohammed bhatti wrote:
    In PL/SQL, if I need to know if I've fetched the last
    row, I can do this:
    IF recCursor%NOTFOUND THEN
    ...
    ...
    END IF;
    How would I do this in Perl? Looking at the DBI docs,
    there does not seem to be a similar method. It
    suggests doing a COUNT(*) or possibly use the
    following:
    $hash_ref = $sth->fetchall_hashref('id');

    So, any similar functionality to %NOTFOUND in Perl?

    tia

    mkb

    __________________________________________________
    Do You Yahoo!?
    Listen to your Yahoo! Mail messages from any phone.
    http://phone.yahoo.com
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Jared Still
    INET: jkstill_at_cybcon.com

    Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
    San Diego, California -- Public Internet access / Mailing Lists
    --------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedOct 2, '01 at 6:51p
activeOct 3, '01 at 4:07a
posts2
users2
websiteoracle.com

2 users in discussion

Jared Still: 1 post Mohammed bhatti: 1 post

People

Translate

site design / logo © 2022 Grokbase