Q&A

  • Stored Procedure 호출 (Delphi, Oracle )






* 사용환경 : 델파이5 / Windows 98/ Oracle 7.3



오라클에서

/////////////////////////////////////////////////////////////////////

CREATE OR REPLACE PROCEDURE INSERT_CUST( ACuscd IN CHAR,

ACusnm IN CHAR,

AReturnCode OUT NUMBER )

IS

LNIndex NUMBER := 1;

BEGIN



IF ACuscd IS NULL THEN

AReturnCode := -1;

Return;

END IF;



UPDATE APCUST

SET CUSNM = ACusnm

WHERE CUSCD = ACuscd;



IF SQL%NOTFOUND THEN



INSERT INTO APCUST ( CUSCD, CUSNM )

VALUES( ACuscd, ACusnm );

END IF;



AReturnCode := 0;



COMMIT;

RETURN;



EXCEPTION

WHEN OTHERS THEN

AReturnCode := -1;

ROLLBACK ;

RETURN ;

END ;

/////////////////////////////////////////////////////////////////////

로 생성을 하고요 델파이에서



procedure TForm1.Button3Click(Sender: TObject);

var

iReturn : Integer;

begin

with StoredProc1 do begin

Params.Clear;

DatabaseName := 'COMPANY';

StoredProcName := 'INSERT_CUST';

params.CreateParam(ftString, 'ACuscd', ptInput).AsString := '1000';

params.CreateParam(ftString, 'ACusnm', ptInput).AsString := '거래처명';

ExecProc;

iReturn := params.CreateParam(ftInteger, 'ARETURNCODE', Output).AsInteger;

end;

end;



실행했더니 ExecProc; 에서 에러메세지가

Operation not applicable 이라고 나더군요.

며칠째 고심하고 있는데 못 찾겠더라구요.

답변기다리겠습니다.

0  COMMENTS