Subject | Re: [firebird-support] Re: query that returns the BLOB ID - not the blob... |
---|---|
Author | Milan Babuskov |
Post date | 2010-12-16T13:26:50Z |
Ken wrote:
of code:
ibase_connect('mydb', 'sysdba', '****') or die(ibase_errmsg());
$res = ibase_query('SELECT ID,MEMO FROM TABLE');
while ($row = ibase_fetch_row($res))
{
$fp = fopen($row[0].'.txt', 'w+');
fwrite($fp, ibase_blob_get($row[1]));
fclose($fp);
}
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> SET BLOB OFF;If you use a scripting language like PHP, you can do it in couple lines
> SELECT ID,MEMO FROM TABLE; (MEMO IS THE BLOB field)
>
> ... then, for each ID/MEMO selected, BLOBDUMP 'memo' ID.TXT
>
> What I would end up with is a SERIES of text files where the name of the file is the ID of the record - and the CONTENTS of the file is the contents of the BLOB.
>
> Is this something that I can run - from a script/commandline?
of code:
ibase_connect('mydb', 'sysdba', '****') or die(ibase_errmsg());
$res = ibase_query('SELECT ID,MEMO FROM TABLE');
while ($row = ibase_fetch_row($res))
{
$fp = fopen($row[0].'.txt', 'w+');
fwrite($fp, ibase_blob_get($row[1]));
fclose($fp);
}
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================