Sequence causes posting error

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
vfclists
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 30.10.2007, 00:07

Sequence causes posting error

Post by vfclists »

When I attempt to add a new record to postgresql table in which the record id integer is generated by a sequence on the server, I get a value required error although the server will generate the value.

Is there some way it can be disabled?

TZQuery has a sequence property? Will setting it to the name of the sequence on the server cause to get an update and update the sequence on the server?

How does it know which field in the table uses that sequence?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

There are two solutions to this problem (you can also search the forum for details)
- Use a TZSequence component and attach it to the query (setting the sequence property to a string won't work).
- set the 'required' property of the query field to false and UpdateMode to umUpdateChanged. The disadvantage of this method is that the assigned id's are not visible without a dataset refresh.

Mark
vfclists
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 30.10.2007, 00:07

Post by vfclists »

I saw the ZSequence component on the component lists and it works quite well with PostgreSQL.

I have had no problems with it so far.
Post Reply