473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sqlloder

Hi,

I loaded amount of data into one table.Table name is SAMPLE. Some of the data inserted correctly. Some data is inserted but not correctly.

My SQL Loder commands:

In command promt, I wrote like

Sqlldr userid=scott/tiger@flower control=sample.ctl log=sample.log

Sample Control file:

Expand|Select|Wrap|Line Numbers
  1. LOAD DATA
  2. INFILE *
  3. INTO TABLE SAMPLE
  4. FIELDS TERMINATED BY ","
  5. (
  6.   ID,
  7.   NAME,
  8.   STREET
  9. )
  10. BEGINDATA
  11. 10,'MICHAEL',JAMKHYA ROAD,89,CROSS STREET,
  12. 20,'SATHEEH',JKOIYTT STKAJ,12,MAIN ROAD',
  13.  

Data loaded like

ID NAME STREET

10 'MICHAEL' JAMKHYA ROAD
20 'SATHEEH' JKOIYTT STKAJ


But I need full values JAMKHYA ROAD,89,CROSS STREET in street columns.


What I found means, the oracle server accepts street columns values up to first comma.because I mention in control file fields terminated by “’ ”.so that only it writes like this.

How to avoid these errors?
Nov 14 '07 #1
4 1618
amitpatel66
2,367 Expert 2GB
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use the tags in future.

MODERATOR.
Nov 14 '07 #2
amitpatel66
2,367 Expert 2GB
Hi,

I loaded amount of data into one table.Table name is SAMPLE. Some of the data inserted correctly. Some data is inserted but not correctly.

My SQL Loder commands:

In command promt, I wrote like

Sqlldr userid=scott/tiger@flower control=sample.ctl log=sample.log

Sample Control file:

Expand|Select|Wrap|Line Numbers
  1. LOAD DATA
  2. INFILE *
  3. INTO TABLE SAMPLE
  4. FIELDS TERMINATED BY ","
  5. (
  6.   ID,
  7.   NAME,
  8.   STREET
  9. )
  10. BEGINDATA
  11. 10,'MICHAEL',JAMKHYA ROAD,89,CROSS STREET,
  12. 20,'SATHEEH',JKOIYTT STKAJ,12,MAIN ROAD',
  13.  

Data loaded like

ID NAME STREET

10 'MICHAEL' JAMKHYA ROAD
20 'SATHEEH' JKOIYTT STKAJ


But I need full values JAMKHYA ROAD,89,CROSS STREET in street columns.


What I found means, the oracle server accepts street columns values up to first comma.because I mention in control file fields terminated by “’ ”.so that only it writes like this.

How to avoid these errors?
Enclose the data in double quotes as shown below:

Expand|Select|Wrap|Line Numbers
  1. LOAD DATA
  2. INFILE *
  3. INTO TABLE SAMPLE
  4. FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
  5. (
  6.   ID,
  7.   NAME,
  8.   STREET
  9. )
  10. BEGINDATA
  11. 10,"MICHAEL","JAMKHYA ROAD,89,CROSS STREET",
  12. 20,"SATHEEH","JKOIYTT STKAJ,12,MAIN ROAD",
  13.  
Nov 14 '07 #3
Enclose the data in double quotes as shown below:

Expand|Select|Wrap|Line Numbers
  1. LOAD DATA
  2. INFILE *
  3. INTO TABLE SAMPLE
  4. FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
  5. (
  6.   ID,
  7.   NAME,
  8.   STREET
  9. )
  10. BEGINDATA
  11. 10,"MICHAEL","JAMKHYA ROAD,89,CROSS STREET",
  12. 20,"SATHEEH","JKOIYTT STKAJ,12,MAIN ROAD",
  13.  

Hi,

I have 200 hundred record..It will take long time .. please tell to other way
Nov 14 '07 #4
amitpatel66
2,367 Expert 2GB
Hi,

I have 200 hundred record..It will take long time .. please tell to other way
SQL LOADER allows two methods:

1. Terminated BY Optionally Enclosed BY
2. POSITION (in case if the data is of fixed length, but it is not so in your case)

you need to go with method 1.

If you have a textpad, copy paste the data in it, create a macro to enclose the text with double quotes and use it.

You can also do that with a excel sheet as well
Nov 14 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.