I need some samples on using KeyGen with TIBCQuery built in runtime
Where can I get this Info.
TIA
rcmz
KeyGen
Please see the following example:
Code: Select all
IBCQuery1.SQL.Text := 'select * from emp';
IBCQuery1.KeyFields := 'empno';
IBCQuery1.KeyGenerator := 'emp_id';
IBCQuery1.Open;
IBCQuery1.Insert;
IBCQuery1.FieldByName('ENAME').AsString := 'AAA';
IBCQuery1.Post;
KeyGenerator property can be used only when you open a SELECT statement, and insert records to this dataset.
If you execute INSERT statement, you should use the generator in this statement:
If you execute INSERT statement, you should use the generator in this statement:
Code: Select all
INSERT INTO CLIENTS (ID, NAME)
VALUES (NEXT VALUE FOR my_gen, 'AAA')