Subject Newbie BLOB question
Author Joe Martinez
I'm attempting (for the first time) to use a table with text BLOBs. I'm
trying to both store data into the BLOB, loaded using LoadFromFile(), and
also retrieve data from the BLOB using SaveToFile. It's not working. Here
are the details:

Table Definition:
CREATE TABLE INFOSHEETS (
CLASSID INTEGER NOT NULL
, SHEETTEXT BLOB
, SHEETDATE TIMESTAMP
, CONSTRAINT INFOSHEETSPK
PRIMARY KEY (CLASSID) )


Here's how I'm saving the data to the BLOB:

(Note: InfoSheetsCursor is a TIB_Cursor, connected to a TIBODatabase, using
the default transaction)
(InfoSheet.txt DOES start out having test in it)

InfoSheetsCursor->Close();
InfoSheetsCursor->SQL->Clear();
InfoSheetsCursor->SQL->Add("select * from infosheets where classid = "
+ (String)IDNumber);
InfoSheetsCursor->First();

(verify that InfoSheetsCursor is not at Eof)

InfoSheetsCursor->FieldByName("sheettext")->LoadFromFile("InfoSheet.txt");


Ok, now, later on, I do the following to retrieve it, using the same IDNumber:

InfoSheetsCursor->Close();
InfoSheetsCursor->SQL->Clear();
InfoSheetsCursor->SQL->Add("select * from infosheets where classid = "
+ (String)IDNumber);
InfoSheetsCursor->First();

(verify that InfoSheetsCursor is not at Eof)

InfoSheetsCursor->FieldByName("sheettext")->SaveToFile("InfoSheet.txt");

The file InfoSheet.txt comes out empty.

I'm not sure whether it's the LoadFromFile() or the SaveToFile() that's
failing, because I don't know any other way to verify that data is being
stored into the BLOB. I'm not getting any exceptions.

Anyone know what I'm doing wrong?

Thanks,
Joe