Home » Infrastructure » Unix » shell script
shell script [message #171387] Tue, 09 May 2006 11:51 Go to next message
chimbs
Messages: 32
Registered: April 2005
Member
Hi,

Can anyone help me to write a shell script which load data from a text file (containing comma delimited datas) into an oracle table? please i am new to shell script.

( ksh)

Thanks a lot
Re: shell script [message #171391 is a reply to message #171387] Tue, 09 May 2006 12:30 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
have'nt tested. But should work

#!/usr/bin/bash
sqlldr userid=username/password control=yourcontrolfile.ctl

Give execute priviliges to file and execute~.
Re: shell script [message #171392 is a reply to message #171391] Tue, 09 May 2006 12:31 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://orafaq.com/faq/sql_loader
Re: shell script [message #171397 is a reply to message #171392] Tue, 09 May 2006 13:16 Go to previous messageGo to next message
chimbs
Messages: 32
Registered: April 2005
Member
is it possible to load data without using Sql loader?
is it possible using only shell script?
Re: shell script [message #171398 is a reply to message #171397] Tue, 09 May 2006 13:23 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You can use PERL to parse through the file.
or even awk, in a few simple cases.
Both options are Pain.
Or
You can use UTL_FILE (Oracle built-in) to read the file line by line
or
Use external tables and treat the file as a table. So No loading is necessary.
Please search the forum.
Re: shell script [message #171401 is a reply to message #171398] Tue, 09 May 2006 13:32 Go to previous messageGo to next message
chimbs
Messages: 32
Registered: April 2005
Member
Thanks Mahesh
Re: shell script [message #171416 is a reply to message #171401] Tue, 09 May 2006 19:42 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
http://www.oracledba.co.uk/tips/env_vars.htm
Previous Topic: What is .bash_profile and .profile
Next Topic: How can I add the 10 th parameter to the shell script
Goto Forum:
  


Current Time: Fri Apr 19 04:18:00 CDT 2024