title: Retrieve the auto-increment value after inserting
body: <p>This is the insert method I am using to insert some data into the db:</p>
  
  <pre><code>public long insertBooking(String userId,int roomId,Timestamp checkInTime, Timestamp checkOutTime){
      final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      ContentValues contentValues=new ContentValues();
  
      contentValues.put(USER_ID, userId);
      contentValues.put(ROOM_ID, roomId);
      contentValues.put(CHECK_IN, dateFormat.format(checkInTime));
      contentValues.put(CHECK_OUT, dateFormat.format(checkOutTime));
  
      return database.insert(MRM_BOOKING_DETAILS_TABLE, null, contentValues);
  
  }
  </code></pre>
  
  <p>The <strong>MRM_BOOKING_DETAILS</strong> table has got an auto-increment field called <strong>booking_id</strong>. After inserting a new row, the value of this column is incremented by 1. Is it possible to return the <strong>booking_id</strong> of the row once the insertion is completed in the above method itself without writing a separate select query? </p>
  
  <p>Or, do I have to write a separate SQL Select query to return that <strong>booking_id</strong> of that newly inserted row?</p>