Oracle

Oracle

Oracle Study

删除数据

delete from a_cids_workorder_info where orderno like ‘2018%’;

创建新表并拷贝旧表内容

create table POOLS_INFO1 as select * from pools_info;

增加字段

alter table a_pools_info add (
NORTH_TRANSITOFFSET_X NUMBER,
SOUTH_TRANSITOFFSET_X NUMBER,
EAST_TRANSITOFFSET_Y NUMBER,
WEST_TRANSITOFFSET_Y NUMBER,
CRANENO VARCHAR2(20 BYTE),
TRANSITOFFSET_Z NUMBER,
NORTH_TRANSITSAFE_X NUMBER,
SOUTH_TRANSITSAFE_X NUMBER,
EAST_TRANSITSAFE_Y NUMBER,
WEST_TRANSITSAFE_Y NUMBER
);

创建序列

Create sequence HIS_ALARMS_seq
increment by 1
start with 1
maxvalue 100000
cycle
nocache;

创建触发器和使用触发器

create or replace trigger HIS_ALARMS_triger
before insert on HIS_ALARMS
for each row
begin
select HIS_ALARMS_seq.nextval
into :new.id
from dual;
end;

©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页