This content has been marked as final. Show 2 replies
I don't believe sequence numbers can be generated automagically just yet. But that's coming in Oracle 12C, I hear. There are ways to get random number in APEX. But, would you consider an alternative? Create your own sequence and populate the key field from the sequence with an INSERT trigger on the table? That's pretty straight-forward once you've done it.
CREATE SEQUENCE <table-name>_SEQ START WITH 1 INCREMENT BY 1 NOMINVALUE NOMAXVALUE NOCYCLE ORDER NOCACHE; GRANT SELECT ON <table-name>_SEQ TO <some-user>_ROLE;
Edited by: Howard (... in Training) on Feb 11, 2013 11:12 AM
create or replace trigger <table-name>_INSERT before insert on <table-name> for each row BEGIN select <table-name>_SEQ.nextval into :new.<primary-key-column-name> from dual; end <table-name>_INSERT; / SHOW ERRORS