Create or replace PROCEDURE Pro_fdn_costuser (
V_BZBM in Tb_if_archives. Bzbm%type,
V_BZMC in Tb_if_archives. Bzmc%type,
V_CJBM in Tb_if_archives. Cjbm%type,
V_CJMC in Tb_if_archives. Cjmc%type,
V_csrq in Tb_if_archives. Csrq%type,
V_DWBM in Tb_if_archives. Dwbm%type,
V_DWMC in Tb_if_archives. Dwmc%type,
V_gbgrbs in Tb_if_archives. Gbgrbs%type,
V_gz in Tb_if_archives. Gz%type,
V_GZMC in Tb_if_archives. Gzmc%type,
V_gzzh in Tb_if_archives. Gzzh%type,
V_jsdj in Tb_if_archives. Jsdj%type,
V_jszc in Tb_if_archives. Jszc%type,
V_mz in Tb_if_archives. Mz%type,
V_RYBM in Tb_if_archives. Rybm%type,
V_RYLB in Tb_if_archives. Rylb%type,
V_sfzg in Tb_if_archives. Sfzg%type,
V_sfzh in Tb_if_archives. Sfzh%type,
V_XB in Tb_if_archives. Xb%type,
V_XM in Tb_if_archives. Xm%type,
V_ZW in Tb_if_archives. Zw%type,
V_ZZMM in Tb_if_archives. Zzmm%type,
V_gl in Tb_if_archives.gl%type,
V_nl in Tb_if_archives.nl%type,
V_XL in Tb_if_archives. Xl%type,
V_insert_date in Tb_if_archives. Insert_date%type
) as
Parcount VARCHAR2 (10);
Begin
Select COUNT (0) into Parcount from Tb_fdn_costuser where XM=V_XM;
if (parcount>0) then
Update Tb_fdn_costuser set QTXX=V_BZMC,KS=V_CJMC,CSRQ=V_CSRQ,ZDMC=V_DWMC,JSDJ=V_JSDJ,MZ=V_MZ,GZZH=V_RYBM,XB=V_XB, XM=V_XM,ZW=V_ZW,ZZMM=V_ZZMM,
Gl=v_gl,nl=v_nl,xl=v_xl,insert_datetime=v_insert_date where XM=V_XM;
Else
Insert into Tb_fdn_costuser (qtxx,ks,csrq,zdmc,jsdj,mz,gzzh,xb,xm,zw,zzmm,gl,nl,xl,insert_datetime)
Values (v_bzmc,v_cjmc,v_csrq,v_dwmc,v_jsdj,v_mz,v_rybm,v_xb,v_xm,v_zw,v_zzmm,v_gl,v_nl,v_xl,v_insert_date);
End If;
End
Oracle Stored Procedures