Need to send a SQL string to Oracle, to firstly "select" and then "insert" on the same table. The code in db is out of my control so have to it like this. Because of the structure of the app, I'm not able to call "select" first, get the new-id and then do insert, they have to be in the same SQL string. Want to do something like following but don't know how to use, or even Oracle has, the variable like this. Have checked this link but not the same case.
var newid number;
SELECT max(id) + 1 into :newid FROM usr;
INSERT INTO usr(id, name) VALUES (:newid, 'new-name');