PgSQL array field lazarus / 16-Databases ---------------------------------------------------------------------- makgab · 2016-02-26 09:44 Hi! How can I use the PgSQL array field in Lazarus? For example the table: id serial, type integer[], somevalue varchar[100] I dropped a DBEdit box to the form and the UpdateSQL like this: UPDATE table SET somevalue=:somevalue,type=:type WHERE id=:id; At runtime the DBEdit box contains (empty value): () I tried to enter into DBEdit: (1,2,3) {1,2,3} But I got: "Invalid type conversion to String in field typeid" What need I do for handling of multiple values? ---------------------------------------------------------------------- mangakissa · 2016-02-26 11:02 DBEdit doesn't know anything about multiple values. This component is linked to one field. So UpdateSQL doesn't know anything whitch values must be assigned to the parameters. If typeid (with I can't see in your example) is an integer, the error is right when you accomplish a string into it. ---------------------------------------------------------------------- goodname · 2016-02-26 13:55 PostgreSQL has a number of functions dealing with arrays. I have used array_to_string in read only queries with Lazarus. Perhaps you can use string_to_array or unnest to make insert or update queries with Lazarus. ---------------------------------------------------------------------- makgab · 2016-02-26 18:25 Quote from: mangakissa on February 26, 2016, 12:02:40 pmIf typeid (with I can't see in your example) is an integer, the error is right when you accomplish a string into it. I wrote: QuoteFor example the table: ... type integer[], .... Can I use any manipulation function in SQLQuery BeforePost event? ---------------------------------------------------------------------- mangakissa · 2016-02-26 22:05 yes, you can. In post #1 QuoteBut I got: "Invalid type conversion to String in field typeid" That's why I talked about this invalid field.