当前位置:网站首页>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
边栏推荐
- 【官宣】长沙软件人才实训基地成立!
- Explanation of input components in Chapter 16
- Migrating your native/mobile application to Unified Plan/WebRTC 1.0 API
- POM of SSM integration xml
- Android clear app cache
- Oracle kills the executing SQL
- [point cloud series] pointfilter: point cloud filtering via encoder decoder modeling
- On the bug of JS regular test method
- Ai21 labs | standing on the shoulders of giant frozen language models
- TIA博途中基于高速计数器触发中断OB40实现定点加工动作的具体方法示例
猜你喜欢

Isparta is a tool that generates webp, GIF and apng from PNG and supports the transformation of webp, GIF and apng

Example of specific method for TIA to trigger interrupt ob40 based on high-speed counter to realize fixed-point machining action

2020年最新字节跳动Android开发者常见面试题及详细解析

超40W奖金池等你来战!第二届“长沙银行杯”腾讯云启创新大赛火热来袭!

AI21 Labs | Standing on the Shoulders of Giant Frozen Language Models(站在巨大的冷冻语言模型的肩膀上)
![[dynamic programming] 221 Largest Square](/img/31/3af4ba05764a683220b5292d3b8780.png)
[dynamic programming] 221 Largest Square

数据仓库—什么是OLAP

MySQL5. 5 installation tutorial

Xi'an CSDN signed a contract with Xi'an Siyuan University, opening a new chapter in IT talent training

9419 page analysis of the latest first-line Internet Android interview questions
随机推荐
鸿蒙系统是抄袭?还是未来?3分钟听完就懂的专业讲解
JS time to get this Monday and Sunday, judge the time is today, before and after today
Ai21 labs | standing on the shoulders of giant frozen language models
Short name of common UI control
Servlet of three web components
交叉碳市场和 Web3 以实现再生变革
解决tp6下载报错Could not find package topthink/think with stability stable.
数据仓库—什么是OLAP
Database transactions
What does the SQL name mean
[point cloud series] Introduction to scene recognition
Common types and basic usage of input plug-in of logstash data processing service
[point cloud series] full revolutionary geometric features
Common commands of ADB shell
Logstash数据处理服务的输入插件Input常见类型以及基本使用
[walking notes]
The interviewer dug a hole for me: how many concurrent TCP connections can a single server have?
切线空间(tangent space)
GDB的使用
"Xiangjian" Technology Salon | programmer & CSDN's advanced road