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.
Error when setting the PgTable "DefaultValues"=true
Re: Error when setting the PgTable "DefaultValues"=true
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.
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
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.
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
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.
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.