Working with arrays

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
DoctorC
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 14.03.2006, 08:35

Working with arrays

Post by DoctorC »

Hi,
I am new to zeos components. I read quite a lot but I couldn't find any info about working with arrays.
I defined in a database a domain MyArray as an array of smallint and a field MyField using this domain
Now how can I work with it from Delphi? How to read and write data to that field?

Thanks for your help
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

What database are you using?

Ben
DoctorC
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 14.03.2006, 08:35

Post by DoctorC »

Ooops,
of course a basic info :)
Firebird 6.1.5 and Delphi 5
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

I don't think there is any built in support for array datatypes in ZeosLib. You may be able to insert data using the builtin firebird SQL commands. I had to do similar in Postgresql some time ago.

Regards,

Ben
DoctorC
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 14.03.2006, 08:35

Post by DoctorC »

I know how to define a field as array, but now I need to insert data in it from Delphi using tzquery, I think.

Does anybody know how to do it?
I defined a param in tzquery:

query.Params.CreateParam(ftArray,'MYARRAY',ptUnknown);

and trying to assign to it a value:

anArray:Array[1..5] of Byte; // defined as an array with the same range as the array field;

query.Params.ParamValues['MYARRAY']:=anArray;


I can't compile the last line as I get an error. Is there another way to assign an array value to the query params?

Thanks for any help
Post Reply