Trihedralguy has asked for the wisdom of the Perl Monks concerning the following question:

Alright, basically I'm just learning Perl/Oracle at a company I'm at as an Intern. I have a script that pulls data from and Oracle database correctly and sucessfully...But it only pulls up to 100 records....After that Perl:DBI just completely stops. Is there an argument somewhere I can change to make it have a larger amount of records. I checked with out DBI and some programming staff members here, and they say that oracle isnt the issuse, they also say it sounds like its a client issue: IE Perl...Can anyone assist me with this, if they have ever heard of anything like this?
  • Comment on DBI and Oracle: Problem fetching ALL records.

Replies are listed 'Best First'.
Re: DBI and Oracle: Problem fetching ALL records.
by perrin (Chancellor) on Jan 06, 2007 at 01:41 UTC
    There is nothing you need to set to make DBI read all the records. Are you positive that your query returns more records when run from the Oracle shell? If so, you may have a bug in your code. If you show us the code, we can probably tell you.
Re: DBI and Oracle: Problem fetching ALL records.
by throop (Chaplain) on Jan 06, 2007 at 08:03 UTC
    Did you
    use strict;
    Did you run with the debugger on?

    Does it always stop in the same place?

    It would be especially helpful to see the code around your main loop that's pulling the records.

    How do you know that it's stopping at 100 records? Could it be writing more records out but not flushing the buffer?

    throop

      I know it stops at 100 because each entry has a # associated with it that links it to the next page. Its bizzar, because It will print 100 of the records out and the rest of the page will be blank (like perl is leaving room for the rest of the data, but its just not there.) I'm not at my computer at the moment, but I will post my code when I get here....Oh yes, I am using strict and there are no errors when I test it in unix.
Re: DBI and Oracle: Problem fetching ALL records.
by jhourcle (Prior) on Jan 06, 2007 at 16:31 UTC

    A couple of questions --

    1. When you say 'completely stops', do you mean it crashes or otherwise errors out, or that the statement handle stop returning records, as if it's run out?
    2. If it's erroring out, what's the error message?
    3. What is the query? Oracle has its own way of limiting the number of returned rows, so you won't see a 'LIMIT 100' or similar, you'll see 'WHERE ROWNUM < 100' or similar.
      It seems as if the statement handle stop returning rows. I dont have any LIMIT on my where ____ LIMIT... etc. There is no error messages, its just simplely not outputing past 100 rows.
        I ran the script this morning through unix and it outputs everything correctly, something must be going wrong inbetween getting it from the server and putting it onto my page...Is there some sort of perl buffer that im viloating?