Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify a generator value

I want to modify a generator value in Delphi with Firebird 2.5. The Statement is: ALTER SEQUENCE GEN_NAME RESTART WITH value . What I want is that the value not to be a number but a variable or a parameter like: ALTER SEQUENCE GEN_TELAGENT_ID RESTART WITH val; where val get a different integer value I don't know yet.

I hope I made myself understood. Sorry for my not so good English. Thanks for the answers.

like image 766
andrei brad Avatar asked Sep 01 '26 11:09

andrei brad


1 Answers

use a parameter, with your preferred components it should work.

myQuery.SQL.Text := 'alter sequence gen_telagent_id restart with :val';
myQuery.Params.ParamByName('val').AsInteger := val;
myQuery.ExecSQL();

Actual syntaxis may vary depending on the components you use to connect to Firebird.

like image 56
jachguate Avatar answered Sep 04 '26 19:09

jachguate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!