PROCEDURE ResetSeq Authid Current_User IS
V_SeqName varchar2 (100);
The BEGIN
Select the decode (mod (trunc (sysdate) - to_Date (' 2014-01-01 ', '- dd yyyy - mm), 2), 1,' SEQ_B ', 'SEQ_A)
INTO V_SeqName from dual;
The EXECUTE IMMEDIATE 'DROP SEQUENCE' | | V_SeqName;
The EXECUTE IMMEDIATE 'CREATE SEQUENCE' | | V_SeqName | | 'increment by 1 start with 1 nocache nocycle';
END;
New job regularly perform
Declare jobno number;
The begin
DBMS_JOB. SUBMIT (: jobno,
'ResetSeq; '
TRUNC (SYSDATE), 'TRUNC (SYSDATE) + 1');
Commit;
end;
Originally stored procedures without Authid Current_User prompts insufficient permissions, then there will be a sequence deleted successful, but not the new strange phenomenon,
After everything is normal, but on the job to perform in it, and out of the question, sequence is deleted, but no new,
CodePudding user response:
No one to help answer itCodePudding user response:
The DROP SEQUENCEThe CREATE SEQUENCE
The two permissions, do the explicit authorization
CodePudding user response:
When dynamic execution of DDL statements, need explicit authorization, cannot borrow role within the jurisdictionCodePudding user response:
Is the problem of authorizationCodePudding user response:
Your problem solved? I met the same problem also execute the stored procedure alone OK sequence deletion in the job but did not create