oracle10g - Load a structured text data file using only one control file -
i have text file need loaded have structure (badly, don't have permit change):
mm/dd/yyyy 24hh:mi:ss no_of_rec emp_id,empname,salary .....
ex:
12/24/2010 20:30:10 number_of_datarow_below e0001,smith,5000 e0002,john,7000 e0003,kewell,9000
into 1 table:
emp(isheader, head_data_time, no_of_rec, emp_id,empname,salary)
columns data type can flexible.
expected load result:
isheader head_data_time no_of_rec emp_id empname salary 1 12/24/2010 20:30:10 3 2 e0001 smith 5000 2 e0002 john 7000 2 e0003 kewell 9000
my solution: using 2 control files:
1. first load header (using option load=1 , truncate mode).
2. second load rest of data (using option skip , append mode).
is there resolving way use 1 control file?
thank you.
my sql loader rusty, not use when clause somehow?
into table emp when rectype = 'e' (rectype position(1:1) char, ...) table emp when rectype != 'e' (rectype position(1:1) char, ...)
Comments
Post a Comment