Marketplace:

 
Active-Venture.com: Cheap hosting for ecommerce and small business
Buy cheap domain registration with free domain search and forwarding services
Cheap domain registration: Register domain name and domain search services at affordable price

 

   

Importing data from Comma Seperated Value (CSV) files

next up previous contents index

1. Create a table:

SQL$>$ desc test;
 Name                      Null?    Type
 ------------------------- -------- --------------
 PIN                                NUMBER
 BALANCE                            NUMBER


2. Create controlfile.txt:



load data
infile 'data.csv'
into table test
fields terminated by "," optionally enclosed by '"'
(
    PIN, BALANCE
)


3. From the oracle server, run:



sqlldr username/password@ control=controlfile.txt


4. Check the result:



SQL> select * from test;

    PIN     BALANCE    
------- -----------
      1        1000
      2       23456
      3          -1



Copyright (c) 1995-2004

 

      

Marketplace:
Facts: " Software Engineering is that part of Computer Science which is too difficult for the Computer Scientist.   "  

Tuesday 22 May 2012 05:44:20 1337665460