프로시저를 만든후 IBExper에서 실행을 하면 정상적으로 값을 가지고 오는데...
c++ 빌더에서 아래의 코딩처럼 하면 RtnValue 값이 무조건 0 이 나오네요..
무엇이 잘못되었을까요?
float RtnValue = 0;
IBSP_GolfAmt->Close();
IBSP_GolfAmt->ParamByName("VSV_GOLF_CD")->AsString = GolfCd;
IBSP_GolfAmt->ParamByName("VSV_GET_YMD")->AsDate = GetYmd;
BSP_GolfAmt->ExecProc();
RtnValue = DM_MainF->IBSP_GolfAmt->FieldByName("VNR_GOLF_AMT")->AsFloat ;
========================================================
Procedure 내용
SET TERM ^ ;
ALTER PROCEDURE SP_GOLF_PRICE (
VSV_GOLF_CD VARCHAR(10),
VSV_GET_YMD DATE)
RETURNS (
VNR_GOLF_AMT FLOAT)
AS
DECLARE VARIABLE LNV_APPLY_AMT NUMERIC(14,0);
begin
VNR_GOLF_AMT = -1;
LNV_APPLY_AMT= -1;
select apply_amt
from golf_price
where golf_cd = :VSV_GOLF_CD
and :VSV_GET_YMD between start_ymd and end_ymd
into :LNV_APPLY_AMT;
if (LNV_APPLY_AMT > 0 ) then
VNR_GOLF_AMT = LNV_APPLY_AMT;
else
select apply_amt
from golf_price
where golf_cd = :VSV_GOLF_CD
and seq = (select min(seq)
from golf_price
where golf_cd = :VSV_GOLF_CD
and apply_amt > 0 )
into :VNR_GOLF_AMT;
-- into :VNR_GOLF_AMT;
/* Procedure Text */
suspend;
end
^
SET TERM ; ^
|