CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI: Re: [sha37] Fetching one row at a time: Edit Log

Veteran / Moderator

Mar 3, 2010, 10:01 AM

Views: 9012
Re: [sha37] Fetching one row at a time

Sorry to say, but that's a very convoluted and inefficient approach.

Start by adding this to both scripts.

use strict; 
use warnings;

Those pragmas should be included in every Perl script you write, and will point out lots of coding mistakes.

Remove the empty prototype definitions. Prototypes should not be used unless you know what they're used for and when they should be used.

Don't use '&' when calling a sub unless you know, understand and want its side effects.

The getqueryresults() sub should either return the complete dataset to the caller in a single call so that the caller can process it, or it should loop over and process the data itself.

If you really want to continue doing it this way, then you need to use the limit clause and keep track of and pass back and forth the record offset numbers.

(This post was edited by FishMonger on Mar 3, 2010, 10:01 AM)

Edit Log:
Post edited by FishMonger (Veteran) on Mar 3, 2010, 10:01 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives