Error while writing a bytea field

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
xrking
Posts: 2
Joined: Fri 11 Sep 2009 08:34

Error while writing a bytea field

Post by xrking » Fri 11 Sep 2009 09:36

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!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 14 Sep 2009 11:52

We could not reproduce the problem. Please send to support*devart*com a complete small sample that demonstrates the problem.

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Post by dschuch » Mon 14 Sep 2009 12:29

also: what fieldking is your field "'file_body'" in delphi? how that field is mapped? do you map it in code or automatically?

xrking
Posts: 2
Joined: Fri 11 Sep 2009 08:34

Post by xrking » Wed 16 Sep 2009 09:00

Sample is sent.

I map the field automatically.

Thank You!

Post Reply