当前位置:网站首页>Oracle defines self incrementing primary keys through triggers and sequences, and sets a scheduled task to insert a piece of data into the target table every second
Oracle defines self incrementing primary keys through triggers and sequences, and sets a scheduled task to insert a piece of data into the target table every second
2022-04-23 13:40:00 【Wangcai 2】
create table classinfo(
classid number(2) primary key,
classname varchar(10) not null
);
-- Create sequence
create sequence CLASSINFO_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
nocache;
CREATE OR REPLACE TRIGGER
CLASSINFO_TRIGGER
before insert on classinfo
for each row
declare
begin
select CLASSINFO_SEQ.NEXTVAL into :NEW.classid from DUAL;
end ;
insert into classinfo values(null,'aaa');
insert into classinfo values(null,'aaa');
insert into classinfo values(null,'aaa');
insert into classinfo values(null,'aaa');
select * from classinfo
create or replace procedure CLASSINFO_PRO is
begin
insert into classinfo values(null,'aaa');
end CLASSINFO_PRO;
declare
job number;
BEGIN
DBMS_JOB.SUBMIT(
JOB => job, /* Automatic generation JOB_ID*/
WHAT => 'CLASSINFO_PRO;', /* The name of the stored procedure to execute or SQL sentence */
NEXT_DATE => sysdate+1/(24*60), /* First execution time next minute */
INTERVAL => 'sysdate+1/(24*60*60)' /* every other 1 Once per second */
);
commit;
end;
select * from user_jobs;

版权声明
本文为[Wangcai 2]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230604301121.html
边栏推荐
- [notes de marche]
- Example interview | sun Guanghao: College Club grows and starts a business with me
- 5 tricky activity life cycle interview questions. After learning, go and hang the interviewer!
- Analysis of the latest Android high frequency interview questions in 2020 (BAT TMD JD Xiaomi)
- 校园外卖系统 - 「农职邦」微信原生云开发小程序
- 【重心坐标插值、透视矫正插值】原理以及用法见解
- Personal learning related
- The interviewer dug a hole for me: how many concurrent TCP connections can a single server have?
- [point cloud series] so net: self organizing network for point cloud analysis
- Super 40W bonus pool waiting for you to fight! The second "Changsha bank Cup" Tencent yunqi innovation competition is hot!
猜你喜欢

Exemple de méthode de réalisation de l'action d'usinage à point fixe basée sur l'interruption de déclenchement du compteur à grande vitesse ob40 pendant le voyage de tia Expo

Machine learning -- PCA and LDA

Analysis of the latest Android high frequency interview questions in 2020 (BAT TMD JD Xiaomi)

Lpddr4 notes

Cross carbon market and Web3 to achieve renewable transformation

Interface idempotency problem

Ai21 labs | standing on the shoulders of giant frozen language models

You and the 42W bonus pool are one short of the "Changsha bank Cup" Tencent yunqi innovation competition!
![[point cloud series] deepmapping: unsupervised map estimation from multiple point clouds](/img/a2/00c2745ec8469a719b180bdd85d1d2.png)
[point cloud series] deepmapping: unsupervised map estimation from multiple point clouds

Tersus notes employee information 516 MySQL query (time period uniqueness judgment of 2 fields)
随机推荐
十万大学生都已成为猿粉,你还在等什么?
Isparta is a tool that generates webp, GIF and apng from PNG and supports the transformation of webp, GIF and apng
Common types and basic usage of input plug-in of logstash data processing service
Machine learning -- PCA and LDA
GDB的使用
Data warehouse - what is OLAP
Aicoco AI frontier promotion (4.23)
Launcher hides app icons that do not need to be displayed
联想拯救者Y9000X 2020
Solve the problem that Oracle needs to set IP every time in the virtual machine
切线空间(tangent space)
Solution: you have 18 unapplied migration (s) Your project may not work properly until you apply
Publish custom plug-ins to local server
[official announcement] Changsha software talent training base was established!
Summary of request and response and their ServletContext
[notes de marche]
叮~ 你的奖学金已到账!C认证企业奖学金名单出炉
./gradlew: Permission denied
Lenovo Savior y9000x 2020
Imx6ull QEMU bare metal tutorial 1: GPIO, iomux, I2C