原文出处:https://community.oracle.com/message/4016489#4016489
Dont't recreate the sequence! You would invalidate all independent objects and lose all privileges granted for the sequences.
Instead try this:
SQL>CREATE SEQUENCE SEQ_TEST
2 START WITH 1
3 INCREMENT BY 1
4 MINVALUE 1
5 MAXVALUE 9999999;
Sequence created.
SQL>
SQL>SELECT SEQ_TEST.NEXTVAL
2 FROM all_objects WHERE ROWNUM < =10;
NEXTVAL
----------
1
2
3
4
5
6
7
8
9
10
10 rows selected.
SQL>
SQL>DECLARE
2 Val NUMBER;
3 BEGIN
4 SELECT SEQ_TEST.CURRVAL
5 INTO Val
6 FROM DUAL;
7
8 EXECUTE IMMEDIATE 'ALTER SEQUENCE SEQ_TEST INCREMENT BY ' || TO_CHAR(1 - Val);
9
10 SELECT SEQ_TEST.NEXTVAL
11 INTO Val
12 FROM DUAL;
13
14 EXECUTE IMMEDIATE 'ALTER SEQUENCE SEQ_TEST INCREMENT BY 1';
15
16 DBMS_OUTPUT.put_line('New value of SEQ_TEST is ' || TO_CHAR(Val));
17 END;
18 /
New value of SEQ_TEST is 1
CREATE OR REPLACE PROCEDURE do_job IS
BEGIN
drop sequence Srno;
create sequence SrNo
minvalue 1
maxvalue 9999999
start with 1
increment by 1
Order;
COMMIT;
END do_job;
Declare
v_job number;
begin
dbms_job_submit
(v_job,'do_job',
last_day(sysdate)+1,
to_char(trunc(last_day(sysdate)+1)+(6/24)));
hth, Urs
相关推荐
and searching through the Help files didn't give you the answers you need, don't hesitate to post your question(s) on Developer Support groups. The latest Help file for Off-line viewing is in the ...
“At the end of the day, I would pound them into oblivion and look forward to the next day when I could recreate the world.” 41 pau l a sch er “ I wanted to make wonderful things, things that ...
To install the package, you only have to run it and follow the instructions on the screen. Nothing more simple. Once installed you can add new versions of the resident applications. WAMP5 ...
picture postcard showing the area you live in and some beautiful stamps for my kids who are stamp collectors. Do not use an envelop, I collect USED postcards sent to me. Write on the postcard that it ...
With this book, you get a step-by-step walkthrough of the best techniques and tools to come out of the OpenKinect project, the largest and most active Kinect hacking community. this book will give ...
In fact, a Fourier analysis can be used to find the amplitude and phase of each of the frequencies and determine how many are needed for reconstructing the pulses to the desired level of precision ...
In this document, the words "tablet" and "digitizer" are used interchange¬ably to mean all absolute point¬ing or digitizing devices that can be made to work with this interface. The definition is ...
For the server, you can modify the list of services supported on the right-hand side, while for the client you can enter a service name and get a list of the servers available on your LAN to support ...
How to deal with networking issues and reliably recreate or simulate these environments How to address multitasking, behind the scenes power drains, and reduce/optimize power usage from the radio and ...
Today's filmmakers often want to recreate the idiosyncrasies of older recording methods, or are looking for something completely new, to differentiate the look of a given project. Furthermore, end-to...
After learning how to set up a Raspberry Pi, you will begin by creating your own version of Flappy Bird and a clone of the classic game Pong in the Scratch programming language. You will also be ...
This book teaches you how to hook up your Raspberry Pi computer, install different games from a variety of genres, and set up emulators so you can play hundreds of classic arcade and console games....
详情见博客:https://blog.csdn.net/qq_20785431/article/details/100519075
How To Drop, Create And Recreate DB Control In A 10g Database [ID 278100.1] Metalink上下载
Fixed: Tries to recreate the tray icon in the case that Windows Explorer crashed; Fixed: The attachment keeps its original filenames when it's open within an external application; Fixed: Find-as-you-...
资源分类:Python库 所属语言:Python 资源全名:docker-recreate-1.4.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
IMPORTANT : Version 0.6.x users and 0.7.0 users, please upgrade to 0.7.4 and RECREATE the database. News/Updates NEW version 0.7.5 available (28 May 2011) Fixes critical bugs about wrong line count,...
虚拟火山 在您的服务器上安装 ...文档 (西班牙语) 贡献 要求 您将需要文档指定的软件。 ...分叉并克隆 repo。... 建造集装箱:提供crane provision 如果要访问数据库,请运行 ...Redistribution and use in source and bi
Note that products, controls and libraries which aren't mentioned in the list below are included in the unified installer for compatibility, but have not been updated. Enhancements and Updates New ...
Note that products, controls and libraries which aren't mentioned in the list below are included in the unified installer for compatibility, but have not been updated. Enhancements and Updates New ...