1. Create table:
declare
num number;
begin
select count(*) into num from all_tables where table_name=upper('eric_emp_tbl') and owner=upper('eric');
if num=1 then
execute immediate 'drop table eric_emp_tbl';
end if;
end;
create table eric_emp_tbl(id number(10), name varchar2(20), birthday date, gender char(2));
2. Create sequence:
declare
num number;
begin
select count(*) into num from user_objects where object_name=upper('eric_emp_seq') and object_type=upper('sequence');
if num=1 then
execute immediate 'drop sequence eric_emp_seq';
end if;
end;
create sequence eric_emp_seq
start with 1
increment by 1
nomaxvalue
nocycle
nocache
3. Create trigger:
declare
num number;
begin
select count(*) into num from user_objects where object_name=upper('eric_emp_tri') and object_type=upper('trigger');
if num=1 then
execute immediate 'drop trigger eric_emp_tri';
end if;
end;
create or replace trigger eric_emp_tri
before insert on eric_emp_tbl
for each row
begin
select eric_emp_seq.nextval into :new.id from dual;
end;
分享到:
相关推荐
Expert Consolidation in Oracle Database 12c is your key to reducing data management costs and increasing data center efficiency. Consolidation and cloud computing are converging trends sweeping the ...
LMS Longest Monotonically Increasing Sequence Algorithm
java java_leetcode题解之Increasing Triplet Subsequence.java
P8 INCREASING ENDOTHELIAL INSULIN-LIKE GROWTH FACTOR-1 RECEPTOR EXPRESSION REDUCES CIRCULATING LEUKOCYTES AND PROTECTS AGAINST ATHEROSCLEROSIS
java java_leetcode题解之Make Array Strictly Increasing.java
java java_leetcode题解之Flip String to Monotone Increasing.java
c++ C++_leetcode题解674. Longest Continuous Increasing Subsequence.cpp
c c语言_leetcode题解之0300_longest_increasing_subsequence
java java_leetcode题解之Longest Increasing Path in a Matrix.java
"image-increasing.rar_matlab 增强_增强"这个压缩包文件,正如其名,包含了一系列MATLAB代码,专注于图像增强的实践应用。 首先,我们要理解图像增强的基本概念。它通常涉及调整图像的亮度、对比度、色彩平衡,...
在当今的数字化时代,"Increasing-Productivity-2.0"这一主题显得尤为重要。随着技术的飞速发展,企业和个人都在寻求提升效率、优化工作流程的方法,以适应日益激烈的竞争环境。2.0版本通常代表着一种升级,意味着在...
6. 定价时机(Price Increasing Timing):在收益管理中,企业需要选择何时提升产品价格,以达到最大化收入的目的。 文章指出,易逝品的定价策略通常存在两种典型情况: - 第一种情况是时尚商品,比如时装。这类...
最长增长子序列(Longest Increasing Subsequence,简称LIS)是序列分析中的一个基本概念,自上世纪以来一直是研究的热点。对于长度为n的序列,可以使用O(n log n)的时间复杂度精确计算其LIS。然而,在亚线性时间下...
标题 "increasing_digital_io_pins_of_arduino_8255A_" 提示我们讨论的主题是关于如何扩展Arduino数字输入/输出(I/O)引脚的数量,具体是通过使用8255A可编程接口芯片来实现。8255A是一种古老的、广泛使用的并行...
MySQL中的"Sort aborted: Out of sort memory"错误通常出现在执行涉及排序操作的SQL查询时,如`ORDER BY`或`GROUP BY`语句。当MySQL在处理这些查询时,它会使用一个名为`sort_buffer_size`的内存缓冲区。...
Challenge: 100Gbit/s around the corner1/37Network stack challengesat increasing speeds The 100Gbit/s challengeJesper Dangaard Brouer Red Hat inc.Linux Conf Au, New Zealand, January 2015Challenge: 100...