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 is a command line shell?

0 Answers  


The information of the two files should be redirect to Third file in such a way that, the third file contain the information like this. 1st line in third file should be from 1st file 2nd line in Third file should be from 2nd file 3rd line in Third file should be from 1st file 4th line in Third file should be from 2nd file - - so on

2 Answers   Caritor,


How to write a function?

0 Answers  


What are the four fundamental components of every file system on linux?

0 Answers  


Differentiate between ‘ and ” quotes.

0 Answers  






What are the different variables present in linux shell?

0 Answers  


How do I open a jshell in cmd?

0 Answers  


What are the default permissions of a file when it is created?

0 Answers  


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

0 Answers  


How to initialize a directory size to a variable??

2 Answers  


How do I run a powershell script?

0 Answers  


RAM one table colums a1,a2,a3,a4 respective values 2,4,7,8 KRISH one table colums a1,a2,a3,a4 respective values 3,4,6,9 IN RAM & KRISH a4 column if comparing values RAM A4 - KRISH A4 ( 8-9 =1 THEN print 5 or (RAM) a4 value 10 KRISH a4 values 2 then 10 -2 =8 print 5*8=40 or diff 5 print same

1 Answers   Tech Mahindra,


Categories