How Connect to a Database in Shell Programming?

Answers were Sorted based on User's Feedback



How Connect to a Database in Shell Programming?..

Answer / ashu

you have a "sqlplus" command to connect to database.

command is as follows:

sqlplus <db_username>/<db_password> @test.sql

Is This Answer Correct ?    19 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / sibin kc

You can simply use as follows.

mysql -h <hostname> -u <user name> -p<password> -e "use
psa;select * from domains where domain_name = 'hai.com';"

Is This Answer Correct ?    9 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / seshadri sethi

(1)1st give "sqlplus"
(2)then it will show "sqlplus" prompt
(3)give "db username"
(4)give "db password"

Is This Answer Correct ?    8 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / supraja

mysql -uusername -ppassword -hipaddress database -e "statement"

eg:mysql -uroot -psuppu -h192.168.0.1 supraja -e "select
count(*) from table"

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What does $$ mean in shell script?

0 Answers  


What is web script?

0 Answers  


What language is bash?

0 Answers  


There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.

1 Answers   Wipro,


How will you emulate wc –l using awk?

0 Answers  


How do I open the shell prompt?

0 Answers  


Is it possible to substitute "ls" command in the place of "echo" command?

0 Answers  


Which is best institute for testing tool?

0 Answers  


Why are there shells on the beach?

0 Answers  


How many prompts are available in a UNIX system?

1 Answers  


What language is shell scripting?

0 Answers  


What is INODE?

2 Answers  


Categories