I'm trying to to use UniQuery and I just need to select the last current Index from a database.
This is what I would like to do :
Code: Select all
if sql_UniQuery.Connection.Connected
then begin
sql_UniQuery.SQL.Text := 'SELECT MAX(TW_LEG_ID)FROM TW_LEG;';
sql_UniQuery.Execute;
id := sql_UniQuery.FieldByName('TW_LEG_ID').AsInteger; // I don't find a way to have the result
I know already that the connection work because I have been able to do the following update :
sql_UniQuery.SQL.Text := 'UPDATE TW_LEG SET AIRLINE_CD = ''AA'' WHERE TW_LEG_ID = 2;';
Does exists a simple way to have it directly through the UniQuery and how to do it?
Thanks for helping
BG
Marc_3