Hi ,
I need to insert in one database archives JPG. I am using C++Builder. How I could make this?
I created the following table:
CREATE TABLE tbimagens
(
callid numeric(11) ,
imagem bytea
)
E I try to insert given of the following form:
TQuery *q;
q = new TQuery(FDatabase1);
try
{
q->DatabaseName = FDatabase1->DatabaseName;
q->Close();
q->SQL->Clear();
q->SQL->Add("insert into tbimagens (callid,imagem) ");
q->SQL->Add("values (:callid,:imagem) ");
q->ParamByName("callid")->AsInteger = callid;
q->ParamByName("imagem")->LoadFromFile(filename,ftBlob);
q->Prepare();
q->ExecSQL();
q->Close();
}__finally
{
delete q;
}
I receive the mesagem from error: Key violation. ERROR: type "lo" does not exist.
Can You help me ? Thank You.
ASS: Fernando.
> -->
> Hello everyone,
>
> I have created a table as follows:
>
> CREATE TABLE document (
> image_id int,
> image bytea
> );
>
> I want to insert a complete file, let's say an open office document
> into this table. Anyone know how I would doe this?
You need to use the bytea functions allocated to your language API.
Which language are you using for this?