IZResultSet not reference last inserted record
Posted: 02.03.2012, 21:35
Hello,
I have the following table in the database:
I'm using the interface ZDBC to insert records:
Connecting to a MySQL database, this code returns the identifier of the last inserted row, but not in Oracle (return 0).
This is a bug?
Tanks,
Josimar
I have the following table in the database:
Code: Select all
PERSON
{
CODE INTEGER (PRIMARY KEY),
NAME VARCHAR
}
Code: Select all
function NewPerson(const Name: string): Integer;
var
Stmt: IZPreparedStatement;
Rs: IZResultSet;
begin
Stmt := Conn.PrepareStatement('SELECT CODE, NAME FROM PERSON');
Rs := Stmt.ExecuteQueryPrepared;
Rs.MoveToInsertRow;
Rs.UpdateString(2, Name);
Rs.InsertRow;
Result := Rs.GetInt(1);
end;
This is a bug?
Tanks,
Josimar