I now want to use stored procedures is to write a job sequence timer to 1, I didn't manually perform the job sequence query before CURRVAL or changed the value of the query NEXTVAL does show has returned 1 because it is to step the value but the query CURRVAL did not show 1 great god can help me solve the
The CREATE OR REPLACE Procedure SEQ_TEST_RESET (SEQ_TEST In Varchar2) Is
N Number (10);
SEQ_TEST_RESET varchar2 (100);
The Begin
The Execute Immediate 'select' | | SEQ_TEST | | 'nextval from dual'
Into n.
N:=- (n - 1);
The Execute Immediate 'the alter sequence' | | SEQ_TEST | | 'increment by' | | n;
The Execute Immediate 'select' | | SEQ_TEST | | 'nextval from dual'
Into n.
The Execute Immediate 'the alter sequence' | | SEQ_TEST | | 'increment by 1'.
End SEQ_TEST_RESET;
This is the stored procedure
DECLARE
The job NUMBER.
The BEGIN
SYS. DBMS_JOB. SUBMIT (
Job=& gt; Job,
What=& gt; 'SEQ_TEST_RESET (' SEQ_TEST "); '
Next_date=& gt; Sysdate + 1/(24 * 60),
The interval=& gt; 'trunc (sysdate,' mi ') + 1/(24 * 60) ',
No_parse=& gt; FALSE);
SYS. DBMS_OUTPUT. PUT_LINE (' Job Number is: '| | to_char (Job));
COMMIT;
The END;
This is the job