oracle触发器替代方案,Oracle触发器 急解决方案

当前位置:我的异常网» C# » Oracle触发器 急解决方案

Oracle触发器 急解决方案

www.myexceptions.net  网友分享于:2013-09-03  浏览:6次

Oracle触发器 急!!!!!

下面是我在sql中写好的触发器,因为没写过oracle的,大家帮忙看下,在oracle里这个该怎么写

alter trigger TongJi_Report

on study

for update

as

declare

@str_StudyInstanceUID varchar(120),

@str_ReportStatus varchar(10),

@str_AccessionNumber varchar(120),

@str_PatientNameC varchar(10),

@str_PatientID varchar(64),

@str_PatientSex varchar(10),

@str_PatientBirthday datetime,

@str_StudyClass2 varchar(50),

@str_SeriesDate datetime,

@str_laiyuan varchar(10),

@str_RECEIVED_CODE varchar(50),

@str_shenqingYiShi varchar(50),

@str_ReportingPhysician varchar(50),

@str_FactPrice varchar(50),

@str_InsuranceType varchar(50),

@str_jianchasuojian varchar(4000),

@str_jianchajielun varchar(4000),

@str_ReportFileLocate varchar(120),

@str_ReportFileName varchar(120)

if update(ReportStatus)

select @str_StudyInstanceUID=StudyInstanceUID,@str_ReportStatus=ReportStatus from inserted

select @str_PatientID=PatientID,@str_PatientNameC=PatientNameC,@str_PatientSex=PatientSex,@str_PatientBirthday=PatientBirthday,@str_AccessionNumber=AccessionNumber,

@str_StudyClass2=StudyClass2,@str_SeriesDate=SeriesDate,@str_laiyuan=laiyuan,@str_RECEIVED_CODE=RECEIVED_CODE,

@str_shenqingYiShi=shenqingYiShi,@str_ReportingPhysician=ReportingPhysician,@str_FactPrice=FactPrice,

@str_InsuranceType=InsuranceType,@str_jianchasuojian=study.jianchasuojian,@str_jianchajielun=study.jianchajielun,

@str_ReportFileLocate=StudyComponent.ReportFileLocate,@str_ReportFileName=StudyComponent.ReportFileName

from Patient,Study,Series,StudyComponent where Patient.PatientUID=study.PatientUID and

Study.StudyInstanceUID=Series.StudyInstanceUID and Series.StudyInstanceUID=StudyComponent.StudyInstanceUID and

Study.StudyInstanceUID =@str_StudyInstanceUID and studycomponent.reportfiletype='jpg'

if(@str_ReportStatus=8 and @str_laiyuan='门诊' and @str_AccessionNumber is not null and @str_AccessionNumber<>'')

begin

if @str_StudyInstanceUID is null

begin

select @str_StudyInstanceUID=''

end

if @str_ReportStatus is null

begin

select @str_ReportStatus=''

end

if @str_AccessionNumber is null

begin

select @str_AccessionNumber=''

end

if @str_PatientNameC is null

begin

select @str_PatientNameC=''

end

if @str_PatientSex is null

begin

select @str_PatientSex=''

end

if @str_PatientBirthday is null

begin

select @str_PatientBirthday=getdate()

end

if @str_StudyClass2 is null

begin

select @str_StudyClass2=''

end

if @str_SeriesDate is null

begin

select @str_SeriesDate=getdate()

end

if @str_laiyuan is null

begin

select @str_laiyuan=''

end

if @str_RECEIVED_CODE is null

begin

select @str_RECEIVED_CODE=''

end

if @str_shenqingYiShi is null

begin

select @str_shenqingYiShi=''

end

if @str_ReportingPhysician is null

begin

select @str_ReportingPhysician=''

end

文章评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值