posted by 구름너머 2009. 10. 23. 11:14

sh에서 오라클 프로시져를 실행하는 예제입니다.

sqlplus -s ID/PASSWORD << MARK > ./log/exeUpdateEtcNor_$1_$THIS_DATE.log
set pause off
set linesize 500
set pagesize 100
set timing on
set serveroutput on

!date;echo "*******<< 작업 시작 >>**********************************************************************************"

!echo "현재일자:"$THIS_DATE


!echo "Step1.프로시져 실행."
DECLARE
AS_CALL_START_DATE VARCHAR2(8);
BEGIN
AS_CALL_START_DATE := '$1';
sp_update_etcnor ( AS_CALL_START_DATE );
COMMIT;
END;
/

!date;echo "*******<< 작업 종료 >>**********************************************************************************"
!echo ""
!echo ""
MARK