Subject | Firebird_2 - Zeos_dbo 6.5.1 - "alter sequence" |
---|---|
Author | giannifilippone |
Post date | 2006-05-15T09:30:34Z |
Hello Group,
can anyone solve a doubt ?
I'm using FB2+Zeos, all is OK & easy if I use TZsequence
with normal autoinc.
But I cannot re_set the generator number; my code here :
SQL.Clear;
SQL.Add('alter sequence sss restart with 7777');
ExecSQL;
conn1.commit;
conn1.starttransaction;
SQL.Clear;
SQL.Add('INSERT into my_table ');
SQL.Add('(cod, descr)');
SQL.Add('values (:cod, :descr)');
ParambyName('cod').AsInteger := sss.GetNextValue;
ParambyName('descr').Asstring:= 'xxxx'+inttostr
(sss.GetCurrentValue);
ExecSQL;
conn1.commit; >>>>> the new value 7777 is ignored and generator
continues incrementing the old value !!?? <<<<<<<<<<<<<<<
Many thanks in advance & regards,
Gianni Filippini
can anyone solve a doubt ?
I'm using FB2+Zeos, all is OK & easy if I use TZsequence
with normal autoinc.
But I cannot re_set the generator number; my code here :
>>>>>>conn1.starttransaction;
SQL.Clear;
SQL.Add('alter sequence sss restart with 7777');
ExecSQL;
conn1.commit;
conn1.starttransaction;
SQL.Clear;
SQL.Add('INSERT into my_table ');
SQL.Add('(cod, descr)');
SQL.Add('values (:cod, :descr)');
ParambyName('cod').AsInteger := sss.GetNextValue;
ParambyName('descr').Asstring:= 'xxxx'+inttostr
(sss.GetCurrentValue);
ExecSQL;
conn1.commit; >>>>> the new value 7777 is ignored and generator
continues incrementing the old value !!?? <<<<<<<<<<<<<<<
Many thanks in advance & regards,
Gianni Filippini