# . . . . . - rest of the code use DBI; # . . . . . - rest of the code # name & location of the database $dbpath = 'C:\Database\database_01.fdb'; $dsn = "DBI:InterBase:database=$dbpath;host=123.456.78.9;ib_dialect=3"; # connesting to DB $dbh = DBI->connect($dsn, '', '', {AutoCommit => 0}) or die "$DBI::errstr"; # setting the size of the buffer (1KB) $dbh -> {LongReadLen} = 1024; # NO matter if Truncation is ON or OFF? Tried both cases! #$dbh -> {LongTruncOk} = 0; $dbh -> {LongTruncOk} = 1; # here, DATA is MEMO field in the database! $sql = "SELECT FIRST 1 DATA FROM CONFIGURATION ORDER BY CREATEDDATE DESC"; $sth = $dbh->prepare($sql) or die "Preparing: ", $dbh->errstr; $sth->execute or die "Executing: ", $sth->errstr; # opening FILE HANDLER for writing the content of the MEMO/BLOB field open (F, ">./database1.txt"); # fetching the content while (@row = $sth->fetchrow_array()) { foreach (@row) { # saving into the file "database1.txt"! print F "$_"; } } close F; $sth->finish; $dbh->commit or warn $dbh->errstr; $dbh->disconnect or warn $dbh->errstr; # . . . . . - rest of the code