Fetching the Oracle ROWID pseudo-column
If you are a fan of the Oracle database, then it is impossible not to have heard about the ROWID pseudo-column. However, as a quick reminder, the ROWID pseudo-column is associated with each row by Oracle, and its main goal is to return the address of the row. The information contained by ROWID can be used to locate a certain row. In jOOQ, we can refer to ROWID via the rowid()
method.
For instance, the following statement inserts a new SALE
and fetches the generated primary key and the ROWID:
ctx.insertInto(SALE, SALE.FISCAL_YEAR, SALE.SALE_, SALE.EMPLOYEE_NUMBER, SALE.FISCAL_MONTH, SALE.REVENUE_GROWTH) .values(2004, 2311.42, 1370L, 1, 0.0) .returningResult(SALE.SALE_ID, rowid()) .fetchOne();...