最近寫了一直Web Service給很多不同站的客戶端呼叫,并直接寄信通知程式中的異常. 直接在oracle中設置某張表的trigger(after insert),當有新的異常資料寫入時候,寄給相關站別的管理員. /* Written by milo on 2017-03-09 *觸發器發送email */ CREATE OR REPLACE TRIGGER small_program_exception_afin AFTER INSERT ON small_program_exception…
CREATE OR REPLACE FUNCTION XF_VIP_AFUPD_WX() RETURNS trigger AS $$ DECLARE i_count integer; s_wx_openid varchar(256); s_docno varchar(60); s_wx_code varchar(256); s_wx_cardid varchar(256); begin if (old.xf_currentbonus!=new.xf_currentbonus) then sele…
Create TRIGGER [dbo].[trigInstructionsDelete] ON dbo.Instructions instead OF DELETE AS BEGIN DECLARE @InsId INT SELECT @InsId=InstructionsID FROM deleted --删除 DELETE dbo.Transfer WHERE InstructionsID=@InsId DELETE dbo.Instructions WHERE InstructionsI…
ALTER SYSTEM SET OPTIMIZER_MODE=RULE scope=both; 其他可以选择的模式还有ALL_ROWS/CHOOSE/FIRST_ROWS/ALL_ROWS. 应用系统优化最好对大查询单独调优,修改优化器模式之后,有可能别的查询又会变慢. 首先,应在PL/SQL工具的执行计划中查看,各种优化器模式下的索引执行情况.然后设置合适的优化器模式…