I have 1000 load files and I know we can load multiple files into one table like this:
LOAD DATA
INFILE file1.txt
INFILE file2.txt
APPEND
INTO TABLE emp
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL
)
But my problem is : I want to insert the data of file1.txt into emp table with some constant values "Cons1" and with some different constant value "Cons2" for the file file2.txt.
I am really stuck into this and tried so much on the net.any help really really appreciated
LOAD DATA
INFILE file1.txt
APPEND
INTO TABLE emp
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL,
**ConstColumn constant "Cons1"**
)
INFILE file2.txt
APPEND
INTO TABLE emp
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL,
**ConstColumn constant "Cons2"**
)