Hi,

If I have a table:
create table messages (
id      int unsigned not null unique,
data    longtext );

and I have a perl script:
1  $sth = $dbh->prepare( "SELECT data FROM messages WHERE id = ?;");
2  $sth->execute($id);
3  $data = $sth->fetchrow;

QUESTION:
will the script stop at line 3 until all data is read into $data?
   (i think it is)
if so, if data is 4GB long, and my NT has 512MB RAM and 512MB 
   pagefile, will the server crash from "out of memory"?
seeing that #2 is a big problem, is there a way to retrieve data
   safely? like retrieiving sections by sections similar to
   
   open SFILE, "filename";
   binmode SFILE;
   while (SFILE->read($data,10000)) { print $data; }

can I use mysql's substring function?
$i = 0;
while (1)
{
1  $sth = $dbh->prepare( "SELECT substring(data,$i,10000) FROM messages
WHERE id = ?;");
2  $sth->execute($id);
3  $data = $sth->fetchrow;
4  print $data;
5  $i += length($data);
   others here
}


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to