PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Adam dot Vile at barclayscapital dot com
Subject: RE: Out of Memory
Date: Mar 17 1999 9:16AM

Excellent news. I'm glad I asked now! Thanks W. Phillip Moore. 

>                                        
> 
> ----------
> From: 	W. Phillip Moore[SMTP:wpm@ms.com]
> Reply To: 	SYBPERL-L@listproc.net
> Sent: 	16 March 1999 20:27
> To: 	SybPerl Discussion List
> Subject: 	Out of Memory
> 
> >>>>> "Michael" == Michael Peppler  writes:
> 
> Michael> Yes, nsql() and sql() store the entire result set in memory.
> 
> Inspired by this depressing statement, I've just submitted a patch to
> Michael which will enhance nsql() to accept a CODE reference which
> will be called for each row of data retreived, preventing the results
> from accumulating en masse in a single array, thus wiping out all of
> your systems physical and virtual memory.
> 
> This allows you to say:
> 
> 	$db->nsql("select * from really_huge_table","HASH",\&parse_rows);
> 
> where each row will be passed to &parse_rows as a hash:
> 
> 	sub parse_rows {
> 	    my %data = @_;
> 	    # have fun wtih %data, a single row from really_huge_table
> 	}
> 
> I'm turning this code loose on my user/developer community here at
> MSDW, and once I am confident the patch won't embarrass me in public,
> I'll post it here.
> 
> W. Phillip Moore                                          Phone:
> 212-762-2433
> Vice President, Infrastructure Development                  FAX:
> 212-762-0174
> Morgan Stanley Dean Witter                                 E-mail:
> wpm@ms.com
> 750 7th Ave, NY, NY 10019
> 
--------------------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.

Internet communications are not secure and therefore the Barclays Group
does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do 
not necessarily represent those of the Barclays Group unless otherwise 
specifically stated.

--------------------------------------------------------------------------------------