CREATE OR REPLACE PROCEDURE "AS_MN_REGNORIN_CHECK" (
p_corp_id IN VARCHAR2,
p_sect_id IN VARCHAR2,
p_req_yymm IN VARCHAR2,
p_req_no IN NUMBER,
p_req_seq IN NUMBER,
p_req_qty IN NUMBER,
p_norin_qty IN NUMBER,
p_oreq_yymm IN VARCHAR2,
p_oreq_no IN NUMBER,
p_oreq_seq IN NUMBER,
p_ncr_num IN VARCHAR2,
p_rtn_cd IN OUT NUMBER,
p_rtn_msg IN OUT VARCHAR2
) AS
/*------------------------------------------------------
-----------------------------------------------------*/
vn_req_qty NUMBER(10) := 0;
vn_norin_qty NUMBER(10) := 0;
vn_consign NUMBER(10) := 0;
SELECT nvl(a.req_qty,0),
nvl(b.norin_qty,0),
(
SELECT count(*)
FROM at_consign_clerk
WHERE corp_id = p_corp_id
AND req_yymm = p_oreq_yymm
AND req_no = p_oreq_no
AND req_seq = p_oreq_seq
AND ncr_num = p_ncr_num
) as count_consign
INTO vn_req_qty,
vn_norin_qty,
vn_consign
FROM AT_SOREQ_ITEM a,
AT_MN_NORIN_REASON b
WHERE a.req_yymm = b.req_yymm(+)
AND a.req_no = b.req_no(+)
AND a.req_seq = b.req_seq(+)
AND a.corp_id = p_corp_id
AND a.sect_id = p_sect_id
AND a.req_yymm = p_req_yymm
AND a.req_no = p_req_no
AND a.req_seq = p_req_seq;
vn_req_qty := vn_req_qty - p_req_qty;
vn_norin_qty := vn_norin_qty - p_norin_qty;
vn_consign := vn_consign;
IF vn_req_qty <> 0 or vn_norin_qty<>0 then
p_rtn_cd := -1;
p_rtn_msg := '-----------';
ROLLBACK;
return;
ELSIF vn_consign<>0 THEN
p_rtn_cd := -1;
p_rtn_msg := '---------------';
ROLLBACK;
return;
END IF;
-----------------------------------------------------------------------
이제 막 오라클을 배우기시작한 신입입니다.
이런 프로시져를 만들어서 호출했는데,
IF문 앞에서 팅겨져 버리네요.그전 값들은 분명 IF문 안으로 들어가야하는건데.
안들어가고 팅겨버려서....그래서 Select문의 값이 2개인가해서 확인했더니..그것도 아니구...혹시 비슷한 경험있으신분들^ _ ^조언부탁드립니다.