Good day! I have a problem trying to make refresh request with TZQuery and TUpdateSQL. I tried different variants but still getting errors (see attachment).
What I have done:
For simple table DEPS (DEP_ID - primary key (autoinc - generator + trigger), NAME varchar, DESCR varchar) generated requests for update sql.
RefreshSQL - select DEP_ID, NAME, DESCR from DEPS where DEP_ID = :OLD_DEP_ID
Connected TZSequence, sequence = GEN_DEP_ID
TZQuery.SequenceField = DEP_ID
DEP_ID.AutogenerateValue = arAutoInc.
What I'm doing wrong?
And other question. Is any way to use ZeosLib with primary key identity style, with no generator name.
How to use TZSequence with firebird 3.0
How to use TZSequence with firebird 3.0
You do not have the required permissions to view the files attached to this post.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: How to use TZSequence with firebird 3.0
Hello,
Maybe it helps if you post a sample create script for your database and a sample application.
Best regards,
Jan
Why do you use TZUpdateSQL with this simple table? It seems to be not necessary?
From your description it is hard to say. Usually you setup a TZSequence object and set the generator name there. Connect that TZSequence object to your Query and set the seqence field to DEP_ID. Finish. Please don't set AutogenerateValue because it simply isn't autogenerated if you use TZSequence.docent83 wrote: ↑31.05.2021, 10:46 I tried different variants but still getting errors (see attachment).
What I have done:
For simple table DEPS (DEP_ID - primary key (autoinc - generator + trigger), NAME varchar, DESCR varchar) generated requests for update sql.
RefreshSQL - select DEP_ID, NAME, DESCR from DEPS where DEP_ID = :OLD_DEP_ID
Connected TZSequence, sequence = GEN_DEP_ID
TZQuery.SequenceField = DEP_ID
DEP_ID.AutogenerateValue = arAutoInc.
What I'm doing wrong?
Maybe it helps if you post a sample create script for your database and a sample application.
As far as I know it should be possible with Zeos 7.3. For Zeos 7.2 please read the release notes. If it isn't mentioned there, it most probably will not work.
Best regards,
Jan
Re: How to use TZSequence with firebird 3.0
First of all, thanks for reply.
All of this was my fault. I found an error - I made two equal databases, but one with generators, and second without (to try identities). I set proper database in design time and didn't switched it in runtime.
So... When you investigating some crime, the main thing is not to get out on yourself
I'm using data modifying from DBGrid, which is using refresh to reload data for edited record.Why do you use TZUpdateSQL with this simple table? It seems to be not necessary?
All of this was my fault. I found an error - I made two equal databases, but one with generators, and second without (to try identities). I set proper database in design time and didn't switched it in runtime.
So... When you investigating some crime, the main thing is not to get out on yourself