Page 1 of 1

Error when setting the PgTable "DefaultValues"=true

Posted: Sun 01 Dec 2013 20:35
by radub
Hello,

I have a small project with PgConnection, PgTable, DataseProvider, ClientDataset components.
If in the PgTable I set the option "DefaultValues"=true, when I open the ClientDataset, I receive the error "Filter expression incorrectly terminated".
The table is formed by an ID serial, and 2 varchar field and an unicity index on one of this varchar fields.

Is there any other options to be set to bypass this error?

Thank you,

Radu B.

Re: Error when setting the PgTable "DefaultValues"=true

Posted: Mon 02 Dec 2013 14:42
by AlexP
Hello,

This problem is due to that ClientDataSet cannot parse the expression returned as a default field value for the Serial type ('nextval(''sequence_name''::regclass)). To solve the problem, you can use a regular field instead of the Serial type and create a trigger, in which a value for this field will be generated.

Re: Error when setting the PgTable "DefaultValues"=true

Posted: Wed 04 Dec 2013 06:59
by radub
Hello,

I have replaced all 186 fields... and after a day long, indeed it works.

It would have been better if the help on "DefaultValues" has had specified such a situation.

Case closed.

Thank you,
Radu B.

Re: Error when setting the PgTable "DefaultValues"=true

Posted: Mon 09 Dec 2013 10:04
by AlexP
Hello,

Unfortunately, we cannot affect the behaviour, since the value for a serial field is set with a sequence and cannot be set while opening the table. We need to get the query for correct retrieving of the sequence value when inserting a new record. As I wrote you earlier, it is better to use a trigger in such a situation.