By: Borland Staff
Abstract: SET GENERATOR my_gen_id TO 0
How do I reset the value for a generator?.
Assume that you have already created a generator in
your database as:
CREATE GENERATOR my_gen_id;
NOTE: The default value of a generator when created is
(0) zero. When you use the generator the first
value assigned to your primary key will depend on
the increment value that you assign in your trigger.
SET GENERATOR my_gen_id TO n;
Where (n) = the new assigned value.
note: You cannot reset the value of the generator inside of
a trigger or stored procedure. You can use the gen_id()
function to increment the value in a generator. The SET
GENERATOR command will only work outside of a stored
procedure or generator.
Free Developer Edition!
Click here to download a free non-expiring Developer Edition or 30-day trial >
More InterBase Info
InterBase XE7 Product Info
Free Developer Edition download
InterBase on Google+
Follow @InterBase on Twitter
Server Response from: ETNASC04