in reply to fetchrow_array memory usage

   My question is the following - does this execute the query and store everything
   in the array prior to printing or does it grab and print one row and at a time
    - which is what I am thinking it does?


Yup -- it executes the query in the database (Update just read Zaxo's reply--y, i guess i'm thinking of RDBMS that support the row-at-a-time fetching) and the "fetch" calls just bring back one row at a time, and you're also right that this (all the fetch* methods) prevents your code from loading the entire result in memory at once. Of course, there are times where loading all-at-once is just fine and that's that the select* (selectrow_*, selectall_*, selectcol_*) DBI functions are for.

Replies are listed 'Best First'.
Re^2: fetchrow_array memory usage
by ctaustin (Sexton) on Jun 22, 2005 at 05:08 UTC
    My RDBMS is Oracle, so it is using cursors - so it looks like I am getting one row at a time.

    Thanks for all of the feedback. I'll be setting the RaiseError now.

    Regards, Tony