Home » RDBMS Server » Server Utilities » Not loading correct information
Not loading correct information [message #171281] Tue, 09 May 2006 04:56 Go to next message
kmsalih
Messages: 197
Registered: March 2006
Senior Member
Hi all,

I am facing a problem with loading data from excel file.

Table
 CREATE TABLE "TESTING"."A"
  (    "A" VARCHAR2(10),
       "B" VARCHAR2(20),
       "C" VARCHAR2(10)
  ) 



Datafile
1,"sample,test",10
2,"sample>test,testing",20



Control file

load 
infile 'load.dat'
into table a 
fields terminated by ',' optionally enclosed by " " 
(a,b,c)


After loading

Select * from a;
A          B                    C
---------- -------------------- ----------
1          "sample              test"
2          "sample>test         testing"


I am not able to load the 10 and 20 in the dat file.

Please help.

Also Searched and still seraching the google.

Thanks inm Advance
SALIH KM

Re: Not loading correct information [message #171289 is a reply to message #171281] Tue, 09 May 2006 05:21 Go to previous messageGo to next message
Frank Naude
Messages: 4587
Registered: April 1998
Senior Member
Looks like a syntax error to me. Try:

fields terminated by ',' optionally enclosed by '"'

Re: Not loading correct information [message #171293 is a reply to message #171281] Tue, 09 May 2006 05:35 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
I think that it is because, your control file says:

fields terminated by ','

The table has only 3 columns and you already have 3 fields terminated by this seperator before you get to either 10 or 20.

you have also mentioned in the control file:

fields terminated by ',' optionally enclosed by " "

but its effect is not seen. -though I do not know the solution for that.
Re: Not loading correct information [message #171301 is a reply to message #171289] Tue, 09 May 2006 06:16 Go to previous message
kmsalih
Messages: 197
Registered: March 2006
Senior Member
Thanks my dear frank.
It is working. Smile
Previous Topic: sqlplus shows password in clear text under cygwin
Next Topic: SQL loader and sybase
Goto Forum:
  


Current Time: Thu Dec 26 08:52:27 CST 2024