Live2d Test Env

oracle创建表前校验是否存在

创建表前检查是否存在,并删除

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--检查是否存在此表,存在则删除
declare
  num number;
begin
  select count(1)
    into num
    from user_tables
   where table_name = upper('表名');
  if num > 0 then
    execute immediate 'drop table 表名';
  end if;
end;
/
--创建表
create table UPDATE_WMS_T_YEAR_BILL(cust_code VARCHAR2(50),
                                    redeem_income NUMBER);
--创建索引
create index CUST_CODE_INDEX on UPDATE_WMS_T_YEAR_BILL(CUST_CODE);

  

posted @   红尘中人·杨哥  阅读(483)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示