Assume data file is not delimited file. file contains data
continuously and we know that data length . i.e Fixed-Width Files
we can also use sql loader for Delimited files
LOAD DATA
INFILE '#INFILE#'
APPEND
INTO TABLE TEST_SCORE (
REPORTING_YEAR POSITION(01:02) CHAR,
LAST_NAME POSITION(03:27) CHAR,
FIRST_NAME POSITION(28:43) CHAR,
MI POSITION(44:44) CHAR,
IMP_FILENAME CONSTANT '#INFILE#',
IMP_FILE_DATE DATE "YYYYMMDD" "#DATE#" ,
IMP_FILE_SEQ CONSTANT #INTEGER#
)
'#INFILE#' is the input data file name.
TEST_SCORE is the target table name
you can call sql loader utility using following command
$sqlldr username/password@dbsid control=control_file_name log=log_file_name data=data_file_name
No comments:
Post a Comment