Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Importing data from Comma Seperated Value (CSV) files


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 © 1995-2006 [email protected]

 
 
  Published under the terms fo the GNU General Public License Design by Interspire