Is it possible to programatically get a currval/nextval from its
backing sequence without actually looking into the SYS
Yes, if you really need to do so. You can simply look up that sequence name in the USER_SEQUENCES
data dictionary view, or better yet USER_TAB_IDENTITY_COLS
data dictionary view, and reference it in your query. Here is an example:
create table t1(
c1 number generated always as identity primary key
);
insert into t1 values(default);
select * from t1;
C1
-----
1
In my case, a sequence's name Oracle has created for the identity column is ISEQ$$_92984
.
select "ISEQ$$_92984".nextval from dual;
NEXTVAL
-------
2
insert into t1 values(default);
select * from t1;
C1
---------
1
3