스 크 립 트 sqlldr ctl 파일 생 성
set echo off
set heading off
set verify off
set feedback off
set show off
set trim off
set pages 0
set concat on
set lines 300
set trimspool on
set trimout on
spool &1..ctl
select 'LOAD DATA'||chr (10)||
-- 'INFILE '''||lower (table_name)||'.dat '''||
'&2 into table '||table_name||chr (10)||
-- 'Append into table '||table_name||chr (10)||
'FIELDS TERMINATED BY "&3"'|| chr (10)||
'TRAILING NULLCOLS'||chr (10)||'('
from user_tables
where table_name = upper ('&4');
select decode (rownum, 1, ' ', ' , ')||
rpad (column_name, 33, ' ')||
decode (data_type,
'VARCHAR2', 'CHAR('||RTRIM(TO_CHAR(DATA_LENGTH+4)) ||') NULLIF ('||column_name||'=BLANKS)'||' "trim(:'||column_name||')"',
'FLOAT', 'DECIMAL EXTERNAL NULLIF('||column_name||'=BLANKS)',
'NUMBER', decode (data_precision, 0,
'INTEGER EXTERNAL NULLIF ('||column_name||
'=BLANKS)', decode (data_scale, 0,
'INTEGER EXTERNAL NULLIF ('||
column_name||'=BLANKS)',
'DECIMAL EXTERNAL NULLIF ('||
column_name||'=BLANKS)')),
'DATE', 'DATE "YYYY-MM-DD" NULLIF ('||column_name||'=BLANKS)',
null)
from
(select * from user_tab_columns
where table_name = upper ('&4')
order by column_id ) t;
select ')'
from sys.dual;
spool off
quit
스 크 립 트 실행 (autogencrtl. bat)
:: zslp_tl_batch test.ctrl sqlldr
:: 1= 、 2=truncate|append... 、 3= 、 4=
sqlplus user/password@dbsid @D:\create_control_extend.sql test append "|" zslp_tl_batch
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
BAT 일괄 처리 서비스 작동 여부를 판단하는 방법(일괄 처리 명령 통합 적용)일괄 처리(Batch), 일괄 처리 스크립트라고도 합니다.말 그대로 일괄 처리는 특정한 대상을 대량으로 처리하는 것으로 일반적으로 간단한 스크립트 언어로 여겨지며 이것은 DOS와 Windows 시스템에 응용된다.일괄...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.