Subject | Blob Field Retrieve Problem |
---|---|
Author | David Husarik |
Post date | 2003-05-16T02:02:42Z |
Hi Group;
I am starting a new project that involves working with
a Blob field. I have not done this before. I am using
Delphi 4.0 with update pack 3 applied, IB Object
version 3.6Dj and Interbase 6.0.2.
I am attempting to save PDF files to a table and then
retrieve and write them back to temporary files. It
would seam that I am able to write the files to the
table. The empty database is 624 KB with 1 table, 2
stored procedures. I am reading 50 PDF files from a CD
with a total size of 9.64 MB. The database table
contains 50 records and the size of the database is
10.4 MB after loading.
Table Def.
CREATE DOMAIN "TABLE_ID" AS INTEGER NOT NULL;
CREATE TABLE "TBL_FEDSTAR"
( "ID" "TABLE_ID",
"RECEIPT_DATE" DATE,
"CD_LABEL" VARCHAR(60),
"VOLUME_NUM" VARCHAR(20),
"SERIAL_NUM" VARCHAR(20),
"DIRECTORY" VARCHAR(75),
"FILE_NAME" VARCHAR(55),
"BLOCK_ID" VARCHAR(15),
"LOAD_DATE" DATE,
"TAXPAYER_ID" VARCHAR(15),
"FORM_NUM" VARCHAR(8),
"TAX_YEAR" VARCHAR(10),
"PDF_FILE" BLOB SUB_TYPE 0 SEGMENT SIZE 16384,
PRIMARY KEY ("ID"));
ib_query.paramByName('PDF_FILE').loadFromFile((readDrive
+ tmpInsertRec[i].directory + '\' +
tmpInsertRec[i].file_name));
ib_query.fieldByName('PDF_FILE').SaveToFile(('C:\FedStar\Temp
Files\' + tmpGetData[i].file_name));
The result of the SaveToFile is that I end up with 50
empty files. I am not sure if I need to be streaming
the files in and out or did I just miss something. Or
could it be that the way the blob field is defined
precludes my using LoadFromFile and SaveToFile. Has
anyone worked with PDF Files before, storing and then
writing back to temporary files for use.
Any help is appreciated.
TIA
David C. Husarik
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
I am starting a new project that involves working with
a Blob field. I have not done this before. I am using
Delphi 4.0 with update pack 3 applied, IB Object
version 3.6Dj and Interbase 6.0.2.
I am attempting to save PDF files to a table and then
retrieve and write them back to temporary files. It
would seam that I am able to write the files to the
table. The empty database is 624 KB with 1 table, 2
stored procedures. I am reading 50 PDF files from a CD
with a total size of 9.64 MB. The database table
contains 50 records and the size of the database is
10.4 MB after loading.
Table Def.
CREATE DOMAIN "TABLE_ID" AS INTEGER NOT NULL;
CREATE TABLE "TBL_FEDSTAR"
( "ID" "TABLE_ID",
"RECEIPT_DATE" DATE,
"CD_LABEL" VARCHAR(60),
"VOLUME_NUM" VARCHAR(20),
"SERIAL_NUM" VARCHAR(20),
"DIRECTORY" VARCHAR(75),
"FILE_NAME" VARCHAR(55),
"BLOCK_ID" VARCHAR(15),
"LOAD_DATE" DATE,
"TAXPAYER_ID" VARCHAR(15),
"FORM_NUM" VARCHAR(8),
"TAX_YEAR" VARCHAR(10),
"PDF_FILE" BLOB SUB_TYPE 0 SEGMENT SIZE 16384,
PRIMARY KEY ("ID"));
ib_query.paramByName('PDF_FILE').loadFromFile((readDrive
+ tmpInsertRec[i].directory + '\' +
tmpInsertRec[i].file_name));
ib_query.fieldByName('PDF_FILE').SaveToFile(('C:\FedStar\Temp
Files\' + tmpGetData[i].file_name));
The result of the SaveToFile is that I end up with 50
empty files. I am not sure if I need to be streaming
the files in and out or did I just miss something. Or
could it be that the way the blob field is defined
precludes my using LoadFromFile and SaveToFile. Has
anyone worked with PDF Files before, storing and then
writing back to temporary files for use.
Any help is appreciated.
TIA
David C. Husarik
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com