Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Import csv file using SQL loader in a shell

Posted on 2013-05-24
3
Medium Priority
?
877 Views
Last Modified: 2013-05-26
Hi,

I would like to import a csv file to a temporary table using SQL loader and write this whole logic in a  shell. Can you please help me. I am kind of new to shell scripting

Temporary_table _name = trades_temp
cvs file name - test.csv

Kindly suggest
0
Comment
Question by:d27m11y
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 1500 total points
ID: 39195318
Use sqlloader and a .ctl file (per .csv) that loads the records. Just have a look at the sqlldr reference, it has some samples.

Sample ctl file: (call it sqlldr.ctl)

load data
 infile 'employee.txt'
 into table employee
 fields terminated by ","
 ( id, name, dept, salary )

Sample script:

sqlldr scott/tiger control=sqlldr.ctl
0
 
LVL 14

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39195400
There are many many examples out there (see google):

e.g.: http://sureshvaishya.blogspot.de/2010/03/based-on-request-from-one-of-our-reader.html
0
 

Author Closing Comment

by:d27m11y
ID: 39197653
Useful
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question