import csv file into table using SQL Loader [but large no. of Columns]

10,981

You should write down the columns (and their type optionally) so as to assign the values of your csv file to each column. You should do this because the order of the columns in the table in your Oracle Database is not known in the script.

After you write the columns in the order they appear in your csv files, you can automate this script for all of your files by typing:

infile *.csv
Share:
10,981
prateek
Author by

prateek

Updated on June 06, 2022

Comments

  • prateek
    prateek almost 2 years

    I want to import data in the form of csv file into a table.[using Oracle SQL developer].I have such hundred files and each has about 50 columns.

    From the wiki of SQL*Loader (http://www.orafaq.com/wiki/SQL*Loader_FAQ)

     load data
     infile 'c:\data\mydata.csv'
     into table emp
     fields terminated by "," optionally enclosed by '"'          
     ( empno, empname, sal, deptno )  //these are the columns headers
    

    What i don't want to do is list down all the column headers.I just want all the enteries in the csv file to be assigned to members in the tables in the order in which they appear.

    Moreover after all think i want to automate it for all the 100 files.