oracle預存程序文法

來源:互聯網
上載者:User

標籤:

1 create or replace procedure lis_zhifang_return_confirm(barcode in varchar2,deptcode1 in varchar2)2 as3 begin4    update  clc_recipe r  set  r.deptcode=deptcode1 , r.deptname=‘檢驗科‘ where r.labcode=barcode;5    commit;6 7 end;

 

 1 CREATE OR REPLACE PROCEDURE peis_transmitresult( 2 barcode in varchar2,   --條碼號 3 excdoctor in varchar2 ,  --執行醫生ID 4 excdoctorname in varchar2,   --執行醫生name 5 excdate in date ,--執行日期 6 result in varchar2 , --結果值 7 indid in varchar2 , --小項id 8 indname in varchar2 , --小項name 9 unnormal in varchar2 , --正異常標誌10 sn in varchar2 , --小項序號11 maxval in varchar2 , --結果最大值12 minval in varchar2 , --結果最小值13 resultunit in varchar2 , --結果單位14 range in varchar2  --參考範圍15 ) 16 as17 --變數區18 v_hosnum varchar2(6) :=‘‘;  --醫院編碼19 v_itemuuid varchar2(20) :=‘‘;--組合的uuid20 v_examid varchar2(15) :=‘‘;--預約單ID21 v_pexamid varchar2(15) :=‘‘;--體檢編號22 v_itemcode varchar2(15) :=‘‘;--項目id23 v_itemname varchar2(50) :=‘‘;--項目name24 v_excdept  varchar2(10) :=‘‘;--執行科室id25 v_excdeptname  varchar2(10) :=‘‘;--執行科室name26 v_excdoctor varchar2(10) :=excdoctor;--執行醫生id27 v_excdoctorname varchar2(20) :=excdoctorname;--執行醫生name28 v_excdate date :=excdate ;   --執行日期29 v_result varchar2(30) :=result ;   --執行日期30 v_indid varchar2(30) :=indid ;   --小項id31 v_indname varchar2(30) :=indname ; --小項name32 v_unnormal varchar2(30) := unnormal ; --正異常標誌33 v_sn varchar2(10) := sn ; --小項序號34 v_maxval varchar2(10) := maxval ; --結果最大值35 v_minval varchar2(10) := minval ; --結果最小值36 v_resultunit varchar2(10) := resultunit ; --單位37 v_range varchar2(10) := range ; --參考範圍38 39 v_count number :=0;  --未傳回結果的數量40 BEGIN41 42 select a.hosnum,a.itemuuid,a.examid,a.pexamid,a.itemcode,a.itemname,a.excdept,a.excdeptname43 44 into v_hosnum,v_itemuuid,v_examid,v_pexamid,v_itemcode,v_itemname,v_excdept,v_excdeptname45 from pexam_items_title a where a.tmcode=barcode;46 --插入結果表47 insert into pexam_results48   (hosnum, examid, pexamid, excdept, excdeptname, excdoctor, excdoctorname, 49   excdate, stringvalue, numvalue, result, comid, comname, indid, indname, 50   examtype, unnormal, itemuuid, sn, maxval, minval, resultunit, range, parentid)51 values52   (v_hosnum, v_examid, v_pexamid, v_excdept, v_excdeptname, v_excdoctor, v_excdoctorname53   , v_excdate, ‘‘, ‘‘, v_result, v_itemcode, v_itemname, v_indid, v_indname,54    ‘‘, v_unnormal, v_itemuuid, v_sn, v_maxval, v_minval, v_resultunit, v_range, ‘‘);55 commit;56 57 --判斷是否組合下面的小項結果都有了, 58 --如果都有了 就回執這個組合  儲存為已完成。  否則不回執。59 select count(*) count into v_count  from pexam_results  c where c.pexamid= v_pexamid60 and c.itemuuid=v_itemuuid  and c.excdate is null ;61 IF v_count=0 THEN62    BEGIN 63        update pexam_items_title a set a.excdate=v_excdate,a.excdoctorid=v_excdoctor, a.excdoctorname=v_excdoctorname,a.deptSum=‘‘ 64        where a.hosnum=v_hosnum and a.itemuuid=v_itemuuid;65        commit;66    END;67  END IF;68 69 END peis_transmitresult;

 

oracle預存程序文法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.