Question: Using sql loader, we will load the file data to table.
But the difficulties is, loading data contains 12 months.
i.e., for each record in a file we have to load 12 records in a table. How to load this type of data in a oracle table? Solution: Although the solution is manual it will work. We can also use cursor to do the same job. CREATE TABLE ZZZ(CTRY VARCHAR2(20), FC VARCHAR2(20), MFT VARCHAR2(20), A200908 VARCHAR2(20), B200909 VARCHAR2(20), C200910 VARCHAR2(20), D200911 VARCHAR2(20), E200912 VARCHAR2(20), F201001 VARCHAR2(20)); DROP TABLE ZZZ; INSERT into zzz values('AT', '001M', 'Ren', '0', '3',
'4', '0', '0', '0'); INSERT into zzz values('AT', '002M', 'Ren', '521',
'614', '574', '613', '448', '503'); INSERT into zzz values('AT', '002M',
'Dac', '0', '3', '2', '0', '0', '0');
CREATE TABLE ZZZ3(CTRY VARCHAR2(20), FC VARCHAR2(20), MFT VARCHAR2(20), DATE1 VARCHAR2(20), Qty VARCHAR2(20)); SELECT ctry, fc, mft, '200908', A200908 FROM ZZZ UNION ALL SELECT ctry, fc, mft, '200910',b200909 FROM ZZZ UNION ALL SELECT ctry, fc, mft, '200910',c200910 FROM ZZZ UNION ALL SELECT ctry, fc, mft, '200911',d200911 FROM ZZZ UNION ALL SELECT ctry, fc, mft, '200912',e200912 FROM ZZZ UNION ALL SELECT ctry, fc, mft, '201001',f201001 FROM ZZZ
Have a Oracle Question
Oracle Books
Oracle Application
Oracle Home
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|