Solved

Sample code for Database connection

Posted on 2007-04-06
4
1,677 Views
Last Modified: 2013-12-26
Hi all,

Can anyone please post sample code for database connection (Oracle or MySQL) using Shell Script.
Please add comment for the scripts, so that I can easily understand the script.

Thanks
0
Comment
Question by:r_kar
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
Comment Utility
mysql << end #invoke mysql and send it a command
select * from database.table;
end
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 35 total points
Comment Utility
For Oracle, use something like:

sqlplus -s / <<EOF
select .....
exit;
EOF

Specify username/password if you don't have externally authenticated accounts.
0
 
LVL 1

Assisted Solution

by:sureshp
sureshp earned 40 total points
Comment Utility
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now