kbys.net
当前位置:首页 >> sql 存储过程iF not Exists 转换成orAClE >>

sql 存储过程iF not Exists 转换成orAClE

create or replace procedure LEIBIE_DEL(p_leibieid shangping.leibieid%type) isbegin delete leibie l where not exists (select 'x' from shangping s where s.leibieid = l.leibieid and s.leibieid = p_leibieid);END LEIBIE_DEL;将leibie...

CREATE OR REPLACE PROCEDURE GETMATERIALCC(sumyear varchar2, wellname varchar2, OUT_CUR OUT SYS_REFCURSOR) AS STRSQL VARCHAR2(4000);BEGIN STRSQL := 'select ''' || sumyear || ''' as 年月,c.countname as 分摊方式,d.departmentname a...

应该是执行了,只是没有符合条件的数据。查看你的SQL条件,有满足的数据么?

嗯,有的埃

--在Oracle里利用PL/SQL创建无输入参数的存储过程create or replace procedure A( temp_cur out sys_refcursor)asbegin open temp_cur for select * from aaaend A;--调用SQL> var robj sys_refcursor;SQL> exec A(:robj);SQL> print robj;--在O...

update zr_ord_orderd2 ord2 set ctradename= (select cpartname from zr_ord_orderd2 where cspec=ord2.cspec)where nvl(ord2.ctradename,' ')=' ' and ord2.zr_ord_master_fk=zr_ord_masteroid and exists(select null from zr_ord_orderd2 wh...

你这个过程其实就是分页查询用户信息是吧 --利用游标返回结果集CREATE OR REPLACE PACKAGE pkg_query AS TYPE cur_query IS REF CURSOR;END pkg_query;CREATE OR REPLACE PROCEDURE UP_UserInfo_List_select ( WhereSql in varchar2, --查询条件...

问题1:当你传入37 时,IF FLAG>5 已经满足条件了,直接V_VALUE :=1;,不会继续判断了。然后就调到end if。可以按f9调试,不信一步步看它的执行过程。 问题2:IF V_NULL=NULL,不是这样写,是IF V_NULL IS NULL ,就会输出888啦。

1 2 3 4 5 6 7 8 9 10 11 12 13 CREATE OR REPLACE PROCEDURE GETMATERIALCC(sumyear varchar2, wellname varchar2, OUT_CUR OUT SYS_REFCURSOR) AS STRSQL VARCHAR2(4000); BEGIN STRSQL := 'select ''' || sumyear || ''' as 年月,c.countname...

CREATE OR REPLACE PROCEDURE UP_TONGJI_GENERATEELCT_1(BEGINDATE IN VARCHAR, ENDDATE IN VARCHAR) IS BEGIN IF BEGINDATE IS NULL AND ENDDATE IS NULL THEN --开始日期2014-01-01 select to_char(add_months(trunc(sysdate),-1),'YYYY-MM')|...

网站首页 | 网站地图
All rights reserved Powered by www.kbys.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com