orale 创建表
来源:互联网 发布:unity3d ios 录屏处理 编辑:程序博客网 时间:2024/04/29 22:21
declare tm_i integer; begin select count(*) into tm_i from user_tables where lower(table_name)=lower('表名'); if tm_i>0 then execute immediate 'drop table 表名 '; end if;end;/-- Create tablecreate table 表名( I_SERIAL_NO NUMBER(22) not null, I_INST_NO NUMBER(22) not null, i_DATE NUMBER(8) not null, VC_STOCKHOLDER VARCHAR2(12) default ' ' not null, I_FUND_ACCOUNT NUMBER(22) not null, VC_EXCHANGE VARCHAR2(20) not null, VC_SEAT VARCHAR2(20) not null, VC_STORAGE_KEY1 VARCHAR2(20) not null, VC_STORAGE_KEY2 VARCHAR2(20) not null, VC_STORAGE_KEY3 VARCHAR2(20) not null, VC_STOCK_CODE VARCHAR2(8) not null, EN_VIRTUAL_AMOUNT NUMBER(22,2) default 0 not null);-- Create/Recreate primary, unique and foreign key constraints alter table 表名 add constraint PK_表名 primary key (I_SERIAL_NO); -- Create sequence declare tm_i integer; begin select count(*) into tm_i from User_Objects t where Lower(t.OBJECT_NAME) = Lower('SEQ_表名') And Lower(t.OBJECT_TYPE) = Lower('Sequence'); if tm_i=0 then execute immediate 'create sequence SEQ_表名 minvalue 1 maxvalue 999999999999999999999999999 start with 1 increment by 1 cache 2'; end if; end;/CREATE OR REPLACE TRIGGER TRIG_表名_IDBEFORE INSERT ON 表名FOR EACH ROWBEGINSelect SEQ_表名 .NEXTVAL INTO :NEW.i_serial_noFROM DUAL;END;
0 0
- orale 创建表
- orale 中创建定时任务
- orale 临时表使用
- Orale导出表空间
- Orale导入表空间
- orale创建用户和赋予权限
- orale tablespace&datafile -- oracle表空间
- orale tablespace&datafile -- oracle表空间
- orale表连接与子查询
- Orale表空间操作理解手记
- 对于orale中的表数据类型的一个简单例子
- orale 已存在的表和 SEQUENCE 查询和删除
- 从orale数据库中的表迁到sqlserver数据库表中
- 获得orale数据库表的主键列名称
- orale 学习
- ORALE触发器
- 初识orale
- orale 当这个字段为空时更新为同一个表的另一个字段的内容
- pp
- BeanUtils\PropertyUtils工具包操作JavaBean
- --alter table myTAB modify myfield not null novalidate;
- 写给准备参加秋招的学弟学妹们~一定要来看哦~
- 一个非常有意思的在线工具网站(绝对不是广告)
- orale 创建表
- uboot移植与源码分析总结(3)-Serial驱动分析
- c语言重定向
- 《收集苹果》 动态规划入门
- 操作系统实验七之内存页面置换算法实验
- 2014-03-29.阿里实习生招聘笔试题目
- linux服务器硬盘监控-shell脚本
- UiScrollView图片浏览器
- oracle管道