赞
踩
CREATE SEQUENCE 序列名
START WITH 1
INCREMENT BY 1
MINVALUE 1
ORDER
NOCYCLE;
//CREATE SEQUENCE “QMS”.“Untitled” MINVALUE 1 INCREMENT BY 1 START WITH 1 ORDER NOCACHE
创建触发器:
create or replace trigger 触发器名
before insert on “表名” for each row
begin
select 序列表名.nextval into :new.“自增的字段” from dual;
end;
//oracle 联合查询示例
select T1.ID,t1.EQUIP_NO,T1.EQUIP_NAME,T1.EQUIP_TYPE,t1.CLASSES,T1.FACTORY,T1.FACTORY_GROUP,T1.LINE,T1.PROCESS_NAME,T1.PROVIDER,T1.EQUIP_IP,T1.SERVER_IP,T1.CREATE_DATE,T1.UPDATE_DATE,T1.MES_EQUIP_TYPE,ET.ID
from(select rownum no, a.* from EQUIPMENT_INFO a WHERE 1 = 1 ) T1
left JOIN EQUIP_TYPE_INFO ET ON ET.SCADA_EQUIP_TYPE = T1.MES_EQUIP_TYPE
where no between 1 and 10 order by T1.ID desc
//PL/SQL语法
DECLARE
V_LANG CLOB := ‘待插入的海量字符串’;
V_UPDATE CLOB := '待更新的海量字符串';
BEGIN
–UPDATE EQUIP_TEST t SET t.IMAGE2 = V_UPDATE WHERE ID = 2; --修改
insert into EQUIP_TEST t (t.ID,t.IMAGE2)VALUES(3,V_UPDATE);
COMMIT;
END;
/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。