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.
Trial Download Week!
Click here to download a free 30-day trial of InterBase XE3 Server or ToGo editions. Or download a free non-expiring Developer Edition >
More InterBase Info
InterBase XE3 Product Info
Free Developer Edition download
InterBase on Google+
Follow @InterBase_ on Twitter
Server Response from: ETNASC04