用SQL命令行:
job:
variable job number;
begin
sys.dbms_job.submit(job => :job,
what => 'clearseq(''SEQ_SN_ID'');',
next_date => to_date('16-10-2012 18:37:20', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'trunc(SYSDATE)+1/24+1');
commit;
end;
/
如果存储过程没有参数,那么:
what => 'clearseq;',
存储过程删除sequence,然后新建sequence,
但要注意,此方法对存储过程掉sequence不能使用,因为删掉一个sequence后再新建后,存储过程要重新编译下才能
使用。
此方法仅给java取sequence使用
create or replace procedure ClearSeq(seqName in varchar) as
n_count number(8);
v_sql varchar(500);
v_code NUMBER;
v_errm VARCHAR2(64);
--mahongmin
begin
select count(1)
into n_count
from user_sequences t
--where t.sequence_name = 'SEQ_SN_ID';
where t.sequence_name = seqName;
if n_count > 0 then
execute immediate 'drop sequence ' || seqName;
end if;
v_sql := 'create sequence ' || seqName ||
' minvalue 1 maxvalue 99999999 start with 1 increment by 1 NOCYCLE cache 20';
execute immediate v_sql;
exception
when others then
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1, 64);
DBMS_OUTPUT.PUT_LINE('重置sequence时, Error code ' || v_code || ': ' ||
v_errm);
end;
分享到:
相关推荐
START WITH 1 —— 从1开始计数 MAXVALUE —— 最大值值 NOMAXVALUE —— 不设置最大值 NOCYCLE —— 一直累加,不循环 CYCLE CACHE 10; 只要定义了emp_sequence,你就可以用使CURRVAL,NEXTVAL CURRVAL=...
解决Invalid byte 1 of 1-byte UTF-8 sequence
invalid multibyte character sequence 870告警1
Sequence to Sequence Learning with Neural Networksv论文PDF版
机器学习之sequence to sequence learning。(Sequence Generation-----Hung-yi Lee 李宏毅.ppt)
SequenceDiagram-3.0.5.zip
Edward Grefenstette - Beyond Sequence to Sequence with Augmented RNNs
A method for assembly sequence planning is proposed in this paper. First, two methods for assembly sequence planning are compared, which are indirect method and direct method. Then, the limits of the ...
基于循环神经网络和注意力机制的Sequence-to-Sequence模型神经网络方法在信息抽取和自动摘要生成方面发挥了重要作用。然而,该方法不能充分利用文本的语言特征信息,且生成结果中存在未登录词问题,从而影响文本摘要...
在Oracle数据库移植过程中,sequence可能失效,本资源可使失效的sequence重新恢复作用
sequence-to-sequence-learning-with-neural-networks.
Sequence Diagrams of UML
sequence1.v
memory networks, are extremely appealing for sequence-tosequence learning tasks. Despite their great success, they typically suffer from a fundamental shortcoming: they are prone to generate ...
Matlab产生m序列的函数-m_sequence1.m 一个产生m序列的函数,希望大家喜欢 function [mseqmatrix]= m_sequence1; n = length; N = 2^n-1; register = [zeros 1];%定义移位寄存器的初始状态 mseqmatrix= ...
sequence-diagram-js 所需jar包,其中sequence-diagram-js支持自定义颜色
oracle中sequence介绍及应用
教你如何使用oracle中的sequence,实现主键自动增长
sequence.txt