Page 1 of 1

Error while writing a bytea field

Posted: Fri 11 Sep 2009 09:36
by xrking
Hello,

I have the following table,

CREATE TABLE "public"."sys_file" (
"file_id" SERIAL,
"file_name" VARCHAR(50) DEFAULT ''::character varying,
"file_body" BYTEA,
CONSTRAINT "sys_file_pkey" PRIMARY KEY("file_id")
) WITHOUT OIDS;

and 'Cannot convert type' error is occur when I try to update the bytea field like that:

myPgQuery.Edit;
TBlobField(myPgQuery.FieldByName('file_body')).LoadFromStream(myStream);
myPgQuery.Post;

Please help!

Posted: Mon 14 Sep 2009 11:52
by Plash
We could not reproduce the problem. Please send to support*devart*com a complete small sample that demonstrates the problem.

Posted: Mon 14 Sep 2009 12:29
by dschuch
also: what fieldking is your field "'file_body'" in delphi? how that field is mapped? do you map it in code or automatically?

Posted: Wed 16 Sep 2009 09:00
by xrking
Sample is sent.

I map the field automatically.

Thank You!