I am calling a stored procedure that is returning the rowid for a list of rows. I am having trouble with storing the actual rowid value in Java so I can then later use that rowid for a follow up update statement.
For example :
Select name, age, ROWID, from myTable where rownum<20;
I can store the name and age, but when I try to store ROWID in a string like:
setRowID(workTableResponseJson.getString("ROWID"));
public void setRowID(String rowid) {
this.rowid = rowid;
}
The value does not exactly match. I instead get a value like :oracle.sql.ROWID@123a123b
Does anyone know how to properly store the rowid value in Java so you can then later use it in a follow up statement?
Thank you.
EDIT: APC answered the question below and I have marked it. Thank you.
The issue was with the query itself. I needed to change:
select rowid
to instead be:
select ROWIDTOCHAR(ROWID)
java was then able to store that value in a string. Although, I did not need to do the second modification as requested as it currently works when I still use:
update name='bob' where rowid=:rowid;