-
SQL Loader control file to create duplicate row
Hi all,
I have data file like below,
NF8,TLEV,F
NF9,"EXPORT,UNLEADED",F
NM2,"EXPORT,LEADED",C
I need to import this data into table, whereas the secound& third row should be duplicated since it has internal comma's
Final value in table should be,
NF8 TLEV F
NF9 EXPORT F
NF9 UNLEADED F
NM2 EXPORT C
NM2 LEADED C
Thanks for your suggestion and effort taken to think abt it , Any kind of ideas is welcomed
-
Can't do that using just SQL Loader
Define the file as an external table, parse it via PL/SQL script -you might have to resort to cursors- and create your final table as desired.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Thanks for early reply, looking forward to implement the same,
but i have one more idea to add with it, please verify whether it is feasible,
Like using simple select query can we,
Split the single row into two row, whr one row with have substr() till comma,
and other row from comma.
if possible please update with code snippets for the same.
-
You had the idea, you do the coding.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|