MySQL Forums
Forum List  »  General

Re: Help pl Mike.
Posted by: Ameet Jayawant
Date: October 29, 2004 12:50PM

Yes, the file is on the server.
Ok, I was doing a "duh". I figured out how to load the file into the blob field. In Delphi, what I did was:
ParamByName('VarBLOB').LoadFromFile(sFileName, ftBlob);

Example:
SQL.Add('insert into zbClientCommImg ');
SQL.Add('(CallCtr, ImgSubj, ImgUploadDT, ImgFileName, CommImg) ');
SQL.Add('VALUES(:VarCID, :VarSubj, :VarDT, :VarFileName, :VarBLOB)');

ParamByName('VarCID').AsInteger := nCallID;
ParamByName('VarSubj').AsString := sSubject;
ParamByName('VarDT').AsDate := Date;
ParamByName('VarFileName').AsString := ExtractFileName(sFileName);
ParamByName('VarBLOB').LoadFromFile(sFileName, ftBlob);

This loads the file into the BLOB field with no problems. Now, all I have to do is figure out how to get it out of the blob field, via a query, and save it to a temp file and open it up when reqd.

Is there a counter function to the LOAD_FILE function which allows me to get the blob data and save it to a file on disk?

Thanx again for your prompt replies.

Options: ReplyQuote


Subject
Written By
Posted
October 29, 2004 11:50AM
October 29, 2004 12:05PM
Re: Help pl Mike.
October 29, 2004 12:50PM
October 29, 2004 12:58PM
October 29, 2004 03:28PM
October 29, 2004 03:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.