Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sample code for Database connection

Posted on 2007-04-06
4
Medium Priority
?
1,693 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 85

Accepted Solution

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

Assisted Solution

by:Tintin
Tintin earned 140 total points
ID: 18879439
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 160 total points
ID: 19017035
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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 …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
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
Course of the Month13 days, 1 hour left to enroll

971 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