oracle常用的几个例子
程序员文章站
2022-07-13 13:57:40
...
--修改表,添加列 alter table F_confirm_car add (ddsj_num INTEGER ); --锁表查询SQL SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid; --alter system kill session 'sid, serial#'; ALTER system kill session '23, 1647'; p_update_club_card_procedure -------------存储过程列子------ CREATE OR REPLACE PROCEDURE P_update_club_card_procedure IS CURSOR cur IS select point as points ,username as v_created , cardid as cardid, id as ids ,vaddtype as v_add_type ,crttime as v_date from CLUB_TT_IMP_POINT_DETAILS t where t.flage='0'; BEGIN FOR cur_result in cur LOOP BEGIN --1,更新积分手工导入临时表 update CLUB_TT_IMP_POINT_DETAILS set flage='1' , dealtime=sysdate where id=cur_result.ids; --2 调用存储过程执行更新 p_club_add_score(cur_result.cardid,to_char(cur_result.v_date,'yyyyMMdd'),cur_result.v_add_type,cur_result.points,cur_result.v_created); END; END LOOP; COMMIT; END; --触发器例子---- CREATE OR REPLACE TRIGGER SAV_BILL_DUTY AFTER INSERT OR UPDATE ON TAS_BILL_DUTY FOR EACH ROW BEGIN INSERT INTO HIS_TAS_BILL_DUTY (VDUTY_COZ_ID, VBILL_ID, VAFFIRMANT, VAFM_DATE, VISSAFETY, VISAPP, VISCONFIRM, VCORROBORATOR, VCONFIRM_DATE, VNOTES, VCREATED, DCRT_DATE, VUPDATED, DUP_DATE) VALUES (:NEW.VDUTY_COZ_ID, :NEW.VBILL_ID, :NEW.VAFFIRMANT, :NEW.VAFM_DATE, :NEW.VISSAFETY, :NEW.VISAPP, :NEW.VISCONFIRM, :NEW.VCORROBORATOR, :NEW.VCONFIRM_DATE, :NEW.VNOTES, :NEW.VCREATED, :NEW.DCRT_DATE, :NEW.VUPDATED, :NEW.DUP_DATE ); END;
推荐阅读
-
Informatica同步数据到ORACLE库需要注意的几个问题 博客分类: ETL Informaticasql serveroracleetl高精度
-
Informatica同步数据到ORACLE库需要注意的几个问题 博客分类: ETL Informaticasql serveroracleetl高精度
-
运维工程师常用的Oracle经典语句——4.使用命令查看Oracle数据库编码、存储过程、所有的表及表结构等信息
-
PHP 常用的正则表达式例子 博客分类: 境-PHP 正则表达式PHP正则表达式例子常用的例子
-
extjs4 几个常用的util Extjs4时间缺省值省略号截取
-
oracle的几个取整函数(转) 博客分类: oracle oracle取整ceilfloorround
-
Oracle几个常用的伪列(Pseudo-column)使用 博客分类: DB-Oracle oracle伪列
-
Oracle几个常用的伪列(Pseudo-column)使用 博客分类: DB-Oracle oracle伪列
-
Maven的几个常用plugin
-
Maven的几个常用plugin