Hello,

I want to INSERT a new record using ZDBC API, then get the LAST_INSERT_ID.

With MySQL would be something like:

'INSERT .... '

then call

'SELECT LAST_INSERT_ID()'

This works for MySQL, I'm not sure if it works for Firebird. 

I would like to know if is there a way to get the latest ID with the ZDBC API 
without call the 'SELECT LAST_INSERT_ID()'.

The following code works with Java (JDBC) to get Last Insert's ID (JDBC):

  resultSet = pstmt.getGeneratedKeys();

  if ( resultSet != null && resultSet.next() )
  {
      newid = resultSet.getInt(1);
  }

Thanks in advance,
Juan

Reply via email to