Page 1 of 1

Working with arrays

Posted: 14.03.2006, 08:40
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

Posted: 14.03.2006, 15:10
by btrewern
What database are you using?

Ben

Posted: 15.03.2006, 07:17
by DoctorC
Ooops,
of course a basic info :)
Firebird 6.1.5 and Delphi 5

Posted: 15.03.2006, 15:00
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

Posted: 15.03.2006, 17:35
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