I have a JSP program that receives SQL UPDATE/INSERT/DELETE statements as text from other JSPs (for different tables of my DB) and this program has to perform a select on the updated data...
For INSERT statements, I tought of using PL/SQL's RETURNING clause to return the ROWID like that :
CallableStatement stmt = conn.prepareCall("BEGIN " + insertStatement + " RETURNING ROWID INTO ?; END;");
stmt.registerOutParameter(1, Types.VARCHAR);
stmt.executeUpdate();
rowId = stmt.getString(1);
It worked great with INSERT...VALUES(...) statements, but with an INSERT...SELECT statement, it fails because this could insert more than one row.
Is there a way of returning more than one ROWID, returning into an array or something... or maybe there's another approach I haven't tought of... ?
Thanks