Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: LNowak at aol dot com
Subject: Re: Query re Sybase::CTlib's ct_sql returning alot of data
Date: Aug 16 2000 4:49PM

In a message dated 08/16/2000 12:21:50 PM Eastern Daylight Time, writes:

<< "
 This one step call is very useful for writing simple, clear code, but has
 one major drawback: the entire query result set is loaded into memory, which
 makes it unusable for processing large result sets. 
 " >>

When working with data sources 2 ways come to mind:
Reading all the data into variable / array / hash array or streaming the data 
in one line/record at a time into variable/array / hash array.

Lets say you have 100mb data source - you can dump all 100 megs in to @data 
taking up 100+mb of ram memory or you can stream it in one record at a time 
keeping amount memory less that one record size. Now if you know the result 
sets going to be small loaded it all up into memory - if the result set is 
unknown or known to be rather large don't risk running out memory and stream 

As for using Sybase::CTlib - I haven't used it very much - I am a big fan of