sorry, but I can't find anything in the Help-File or the demos for this "easy" problem.
I use an TIBCQuery to insert data into an Table
Code: Select all
MyTable
ID: BigInt;
Name: VarChar(100);
The InsertCode is:
Code: Select all
FIBCQuery.SQL.Clear;
FIBCQuery.SQL.Add('INSERT INTO mytable (NAME)');
FIBCQuery.SQL.Add('VALUES (:NAME)');
FIBCQuery.SQL.Add('RETURNING ID');
FIBCQuery.ParamByName('NAME').AsString := AName;
FIBCQuery.Prepare;
FIBCQuery.Execute;
if FIBCQuery.RecordCount > 0 then
begin
result := FIBCQuery.ParamByName('ID').Value;
end else
begin
result := -1;
end;
I have tried several things:
Code: Select all
FIBCQuery.Options.ReturnParams := TRUE;
//---
FIBCQuery.DMLRefresh := TRUE;
I use Delphi 2007 with IBDAC 3.50.19
Chris