How Connect to a Database in Shell Programming?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
In shell scripting if text is surrounded by single quotes what does it denotes?
on “sed” command EmpData(Sample Database) 1122|j.b. saxena |g.m. |account |12/12/52|6000 2233|n.k. gupta |d.g.m |sales |31/12/40|9000 4545|anil agarwal |director |account |06/07/47|7500 5656|lalit choudhury |executive|marketing|07/09/50|5000 1265|chanchal singhvi|g.m. |admin |12/09/63|6000 0110|shyam saksena |chairman |marketing|12/12/43|8000 5566|jai sharma |director |account |23/12/89|7000 7733|jayant |d.g.m |sales |29/02/70|6000 1. From the above database substitute the delimiter of first 3 lines with “ : “ 2. From the above database substitute the delimiter with “ : ” 3. Insert the string “ XYZ Employees” in the first line. 4. Store the lines pertaining to the directors, d.g.m and g.m into three separate files. 5. Using address store first 4 lines into a file Empupdate. 6. Find the pattern “account” in the database and replaces that with “accounts”. 7. Select those lines which do not have a pattern “g.m”. 8. Insert a blank line after every line in the database.
How to initialize a directory size to a variable??
What are the additional egrep symbols?
How to know that your remote server is ruing smoothly or not in unix?
Explore about environment variables?
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
How to get the 3rd element/column from each line from a file?
Please anyone suggest atleast 2 good training institutes in Hyderabad, INDIA where i can learn unix shell scripting.
Hi Friends, I am currently Undergoing Course On Testing.I am Planning To Keep Fake Resume.Can any One tell me the ways to Prepare i.e, Real Time experience For Manual Testing. With Regards, Vikram
Explain about non-login shell files?
c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command