Page 1 of 1

zSequence -

Posted: 15.06.2011, 18:10
by sfxcc
Can anyone explain why zquery have zSequence.

If i have a multiple / user using db i cant do zsequnec.last id because it couldnot be that the last posted, and i cant use the Query 'insert etc ect returning id' because is visual control not supposed a mix.

How can i have the last id on a open table or zquery 'select * from atable'

I have a Table
CREATE TABLE ATABLE(
AT_ID INTEGER, -with generator/trigger of + 1
AT_NAME VARCHAR(100),
AT_SOME)

i supose that if i use the zSequence on zQuery it should get the id auto whne we insert a new line on a grid for example.

Thanks

Posted: 30.10.2011, 22:26
by mdaems
Indeed, ZSequence is a component that can get sequences from your database when it's impemented for your database. (Seems like that's implemented for FB/IB, Oracle and Postgres)
Create a ZSequence component. Fill out the sequence name. And connect it to your query. I suppose it will be used automatically for a primary key field when you leave that empty on insert.
Afterwards you can read out the ZSequence value.

Mark