|Need help to write SQL*LOADER control file. [message #270133]
||Tue, 25 September 2007 18:47
Registered: September 2007
I have a source *.csv file that I am loading in oracle database TABLE ( oracle 9i versin 9.2) |
using SQL*LOADER. I am trying to explain the scenario below.
data file: product_metatag.csv
2001,"Peep-toe Shoe, Women's, Seen in Hollywood"
2002,"Star watch, flat, ballerina shoes"
2003,"patent shoes, ballerina shoes, low, flat shoe"
2004,"round toe, high heel"
2005,"men's business wear, casual male, dating scene"
2006,"men's business wear"
2007,"pointy toe, women's,high"
2008, men's business wear
2009, ballerina shoes
Note : there are 2 columns in source file ( column heading is there)
if there is coma (,) in the values under DESCRIPTION column then, values appears enclosed by " "
othervise value is not enclosed in " "( check record with styl: 2008, 2009).
only values under DESCRIPTION column is loaded in the target table named: metadata.
values under styl column should not be loaded in target table ( filler )
TARGET TABLE: metadata (should look like this:)
1001 Peep-toe Shoe
1003 Seen in Hollywood
1004 Star watch
1006 ballerina shoes
1008 flat shoe
1009 round toe
1010 high heel
1011 men's business wear
1012 casual male
1013 dating scene
1014 pointy toe
Note: METATAG is primary key , so each value under METATAG must appear only once.
ID is generated by ORACLE SEQUENCE.
Que: i created control file. I USED multiple 'INTO' STATEMENT and I used the sql*loader keyword POSITION,
to read the same physical record from differnt position and load in to target table column: metatag.
but i couldnt succeded. i didnt get desired result.
can someone please give me logic in control file to load the source data in desired format?
any help will be highly appreciated