Subject | Re: [firebird-support] Linux tools for Firebird - question |
---|---|
Author | Milan Babuskov |
Post date | 2011-05-27T11:33:43Z |
Marcin Bury wrote:
Here's a C++ example:
http://www.firebirdfaq.org/faq122
Here's PHP example:
---- loadblob.php --------------
$myfile = $argv[1];
$database = $argv[2];
$user = $argv[3];
$password = $argv[4];
ibase_connect($database, $user, $password) or die(ibase_errmsg());
$fd = fopen($myfile, 'r');
$blob = ibase_blob_import($fd);
fclose($fd);
ibase_query("update table1 set blob_field = ?", $blob)
or die(ibase_errmsg());
--------------------------------
Usage:
php -f loadblob.php file.to.import database_path username password
You could customize table and column name as well.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> Does someone know a linux command tool that can load a file into a blobI don't know of any, but you can create one in a few lines of code.
> column?
Here's a C++ example:
http://www.firebirdfaq.org/faq122
Here's PHP example:
---- loadblob.php --------------
$myfile = $argv[1];
$database = $argv[2];
$user = $argv[3];
$password = $argv[4];
ibase_connect($database, $user, $password) or die(ibase_errmsg());
$fd = fopen($myfile, 'r');
$blob = ibase_blob_import($fd);
fclose($fd);
ibase_query("update table1 set blob_field = ?", $blob)
or die(ibase_errmsg());
--------------------------------
Usage:
php -f loadblob.php file.to.import database_path username password
You could customize table and column name as well.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================