Question:
How Connect to a Database in Shell Programming?Please tell me Step by Step
Answer:
Suppose you are using db2 and ksh
----------------------------
#!/usr/bin/ksh
connect to <Serve Name>:<Port NO>@<Instance Name> user <USERID> using <Passwd>
-----------------------------------
If u have profile and catalog then
----------------------------------
#!/usr/bin/ksh
db2 connect to <SID>
-----------------------------------
To run a sample proc .. use the below
db2 "<Proc Name>"
Source: CoolInterview.com
To connect informix DB - isql <DB instance@DB>
To connect orancle DB
sqlplus <DBinstance@DB> Source: CoolInterview.com
Answered by: kalaivani | Date: 12/16/2009
| Contact kalaivani
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|