When trying to change the value of a generator, I found that it was not changed.
I'm using Firebird 4 with Zeos 8 (trunk)
In the following script: set generator GEN_CODIGO to 99
I already tried using the TZQuery, TZSQLProcessor components and was unsuccessful
I also tried running directly through the connection, without success.
Generator
Moderators: gto, cipto_kh, EgonHugeist
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Generator
There seems to be some weird interaction between the set generator statement and Firebird transactions. The following works for me:
Code: Select all
Conn.Connect;
Conn.StartTransaction;
Conn.ExecuteDirect('set generator TEST to 99');
Conn.Commit;
-
- Fresh Boarder
- Posts: 3
- Joined: 02.05.2024, 01:29
Re: Generator
problem solved. You have to use it
StartTransaction and Commit
Example:
Conn.StartTransaction;
Qry. Close;
Qry. SQL. Clear;
Qry. SQL. Add('set generator TEST to 99');
Qry. ExecSQL;
Conn.Commit;
or
Conn.Connect;
Conn.StartTransaction;
Conn.ExecuteDirect('set generator TEST to 99');
Conn.Commit;
StartTransaction and Commit
Example:
Conn.StartTransaction;
Qry. Close;
Qry. SQL. Clear;
Qry. SQL. Add('set generator TEST to 99');
Qry. ExecSQL;
Conn.Commit;
or
Conn.Connect;
Conn.StartTransaction;
Conn.ExecuteDirect('set generator TEST to 99');
Conn.Commit;