当前位置:网站首页>oracle 触发器创建
oracle 触发器创建
2022-07-25 07:39:00 【CSDN问答】
oracle创建一个触发器,有一张表结构如下

我想求的是如果插入一条新数据,dept_name为南京,不插入dept_code 的情况下,根据dept_name,给他加上320110
用触发器做,每插入一行执行一次
代码如下
create table ceshi (id number,name VARCHAR2(50),dept_name VARCHAR2(50),dept_code VARCHAR2(50))
insert into ceshi values(1,'zhangsan','北京','110000');
insert into ceshi values(2,'zhangsan','上海','310000');
insert into ceshi values(3,'zhangsan','南京','320100');
insert into ceshi values(4,'zhangsan','深圳','440300');
insert into ceshi values(5,'zhangsan','广州','440100');
commit;
select * from ceshi
边栏推荐
- Practical operation: elegant downtime under large-scale micro service architecture
- [unity entry program] make my first little game
- [notes for question brushing] search the insertion position (flexible use of dichotomy)
- Cluster chat server: summary of project problems
- 【Unity入门计划】界面介绍(2)-Games视图&Hierarchy&Project&Inspector
- [unity introduction program] basic concepts GameObject & components
- P1049 [NOIP2001 普及组 T4] 装箱问题
- How does MTK change the boot logo?
- Load capacity - sorting out the mind map that affects load capacity
- The application of for loop and if judgment statement
猜你喜欢

【Unity入门计划】基本概念-触发器 Trigger

What if Oracle 19C migration encounters large lob tables?

Xinku online | cnopendata shareholder information data of A-share listed companies

Teach you to use cann to convert photos into cartoon style

Line generation (matrix ')

【微信小程序】全局样式、局部样式、全局配置

diagramscene工程难点分析

New version 8.6 SEO quick release system (can be built at source level)

Lidar construction map (overlay grid construction map)

Matlab self programming series (1) -- angular distribution function
随机推荐
【论文笔记】Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized
Talk about programmers learning English again
[unity entry program] make my first little game
DJI push code (one code for one use, limited time push)
A fast method of data set enhancement for deep learning
Tunnel broadcasting and wireless trunking communication broadcasting system - the case of Tiantaishan tunnel
【Unity入门计划】基本概念-预制件 Prefab
3. Promise
How does MTK change the boot logo?
9 best engineering construction project management systems
JS cannot get content disposition in headers
Before Oracle 19C migration, how important is it to do a good job of rat playback test?
[programmer 2 Civil Servant] IV. common problems
Problems during nanodet training: modulenotfounderror: no module named 'nanodet' solution
When deep learning makes data sets, it specifies how many frames to extract an image from the long video to the specified file path
Polling, interrupt, DMA and channel
A domestic open source redis visualization tool that is super easy to use, with a high-value UI, which is really fragrant!!
2-6.自动化采集
[ES6] function parameters, symbol data types, iterators and generators
What are the types of financial products in 2022? Which is suitable for beginners?