I have a problem getting my SEQUENCE. I have created a sequence as administrator and have grant select and alter privileges to the other user.
CREATE SEQUENCE "OWNER"."TOT_SEQ" MINVALUE 1000 MAXVALUE 1000000000 INCREMENT BY 1 START WITH 1000 CACHE 20 NOORDER NOCYCLE ;
grant select,ALTER on TOT_SEQ to user;
commit;
When I do this :
select sequence_name from all_sequences;
TOT_SEQ
I can see my SEQUENCE in the list.
But I can't access the sequence in my code. using :
select <SEQUNCE_name>.nextval from dual;
What am I doing wrong?
ORA-02289: sequence does not exist Cause: The specified sequence does not exist, or the user does not have the required privilege to perform this operation. Action: Make sure the sequence name is correct, and that you have the right to perform the desired operation on this sequence. privilege to perform this operation.
Details of error are as follows. ORA-02289: sequence does not exist Cause: The specified sequence does not exist, or the user does not have the required privilege to perform this operation. Action: Make sure the sequence name is correct, and that you have the right to perform the desired operation on this sequence.
Cause:The specified sequence does not exist, or the user does not have the required privilege to perform this operation. Action:Make sure the sequence name is correct, and that you have the right to perform the desired operation on this sequence.
CREATE PUBLIC SYNONYM TOT_SEQ for OWNER.TOT_SEQ; SELECT TOT_SEQ.nexval FROM DUAL; Then you will have to fully qualify your sequence name by adding the sequence owner to it.
You will either have to fully qualify your sequence via:
SELECT <owner>.<sequence name>.nextval FROM dual;
Or create a public synonym for it:
CREATE PUBLIC SYNONYM TOT_SEQ for OWNER.TOT_SEQ;
SELECT TOT_SEQ.nexval FROM DUAL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With