작업 스케줄러에서 (매 5분마다 실행되게하는 루틴)
------------------------------------------------------------------------------------
xxxx. bat
------------------------------------------------------------------------------------
@echo off
set connect_info=USERID/USERPASSWD@PEDWDB
set sql=sqlplus -s %connect_info% @D:\sw\IBM\EDW_Batch\edw_bat_check.sql
set file=D:\sw\IBM\EDW_Batch\Success.txt
FOR /F "usebackq" %%i IN (`%sql%`) DO set x=%%i
echo %x%
if %x%==Y (type NUL>%file%)
------------------------------------------------------------------------------------
============================================================================================
============================================================================================
------------------------------------------------------------------------------------
xxx.sql
------------------------------------------------------------------------------------
set serveroutput on
set feedback off
DECLARE
pBASE_DT VARCHAR2(8);
pYN VARCHAR2(10);
BEGIN
SELECT TO_CHAR(SYSDATE - 1, 'YYYYMMDD')
INTO pBASE_DT
FROM DUAL;
SELECT BASE_DT||ACNT_CMPL_YN||FILE_TRNM_YN
INTO pYN
FROM TODCMJOBPRMNGL
WHERE BASE_DT = pBASE_DT;
IF pYN = pBASE_DT||'Y'||'N'
THEN
DBMS_OUTPUT.PUT_LINE('Y');
ELSE DBMS_OUTPUT.PUT_LINE('N');
END IF;
END;
/
exit
------------------------------------------------------------------------------------
'wif LiNoUz > DATASTAGE' 카테고리의 다른 글
[.NET] PerformanceCounter를 이용한 CPU, 메모리(Memory) 사용률 표시하기 (0) | 2013.01.14 |
---|---|
DATSTAGE, DB2 backup (0) | 2013.01.14 |
DATSTAGE SPECIFIC (0) | 2012.12.13 |
ODS에서 엔터값 잘못 맥인것 (0) | 2012.11.14 |
Informatica Client기본설정 연습 (0) | 2012.10.11 |