Home » RDBMS Server » Server Utilities » How to write a control file for below data file ( Its a fixed length)
How to write a control file for below data file ( Its a fixed length) [message #227022] Tue, 27 March 2007 02:50 Go to next message
donind
Messages: 95
Registered: February 2007
Member
Hi,

Here is my table
create table sample1 (name varchar2(5), num number(2));

sample.txt(Datafile)
vikram12
sharma13
sonu 14

Here is my control file
load data
infile 'C:\sample.txt'
into table sample1
fields terminated by "," optionally enclosed by '"'
( name char(5), num char(2) )

But it rejecting all the records. Just let me know where i went wrong.

Thanks in advance
Re: How to write a control file for below data file ( Its a fixed length) [message #227036 is a reply to message #227022] Tue, 27 March 2007 03:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Does your fields separated (terminated) by ","?
No.
So use another syntax.
Maybe your fields are fixed length.
Have a look at: "Database Utilities", Part II SQL*Loader.

Regards
Michel

Re: How to write a control file for below data file ( Its a fixed length) [message #227040 is a reply to message #227022] Tue, 27 March 2007 03:32 Go to previous messageGo to next message
donind
Messages: 95
Registered: February 2007
Member
Hi,

Its not a comma seperated data file.

if i remove this line "fields terminated by "," optionally enclosed by '"' "

will it work fine.


Here the file looks like

sample1.txt
vikram12
sharma13
joe 14
shan 15

Thanks
Re: How to write a control file for below data file ( Its a fixed length) [message #227187 is a reply to message #227040] Tue, 27 March 2007 08:33 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
donind wrote on Tue, 27 March 2007 04:32
Hi,

Its not a comma seperated data file.

if i remove this line "fields terminated by "," optionally enclosed by '"' "

will it work fine.



Why don't you try it and tells us what happens? Is it really that hard to try?

If you want to show us a valid picture of your data, use code tags so we can see it in it's true form. After all thesep osts you should know that by now.
Previous Topic: error while exp utility
Next Topic: can we use '<' with WHEN in sqlldr??
Goto Forum:
  


Current Time: Wed Dec 25 21:23:31 CST 2024