Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on shell script within the Unix/Linux forums, part of the Operating Systems category; anyone please suggest me tutorial for database connectivity in unix shell scripts? i think we can use the same commands we run in the shell prompt. is it?...
|
|||||||
|
|||
|
shell script
anyone please suggest me tutorial for database connectivity in unix shell scripts?
i think we can use the same commands we run in the shell prompt. is it? |
| The Following User Says Thank You to Barbie For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: shell script
Hi shal raji,
i learnt about it. there is no special syntax to do this. just connect to database using "sqlplus" as u will do in shell prompt and go on with ur sql queries. thats it. but i don know any link to learn about this. if i get to know any link, i will it post here. |
|
|||
|
Re: shell script
there is no special command for data base connectivity
i use informix database with unix i write all informix command in a shell and if executed with authentication to data base the result is same i am able to mix normal scripting command with database command i enables me do write database related cron very easily |
|
|||
|
Re: shell script
isql -s$servername -u$username -p$password this is the syntax i think...
|
| The Following User Says Thank You to meeluch For This Useful Post: | ||
|
|||
|
Re: shell script
yes u can use the same commands that u use in shell. But u have to set oracle's environment variables in the script.
|
|
|||
|
Re: shell script
This expression filters out all the files listed out by the commands 'ls -l' and the removes the files having names containing the DOT (.) character.
grep is for pattern matching. grep with '-v' takes out only those which don't match that pattern. In the pattern. '\.' refers to the dot character. The other dots refer to any one or more occurance of the said character. Pl note that apparently it may lists out the directoies (because directory names have no dot usually), but it is not. You get the same result for '.\.' also. Hope you have got the answer. |
|
|||
|
Re: shell script
Just write a shell script:- sample posted below
result=`sqlplus -s har/har < set heading off set verify off select count(*) from table.abc@cinder; commit; exit eof!` |
|
|||
|
Re: shell script
isql
An interactive command-line shell that allows executing SQL statements isql -S Example: isql –SNYP_LASER1 -Umacigrab -Pmacigrab -c -w 20000000000 use dbloan 1> SELECT COUNT(*) FROM agreements 2> ----------- 363 (1 row affected) 1> SELECT MAX(agreement_id) FROM agreements 2> ----------- 365 (1 row affected) 1> exit |
|
|||
|
isql
An interactive command-line shell that allows executing SQL statements isql -S Example: isql –SNYP_LASER1 -Umacigrab -Pmacigrab -c -w 20000000000 use dbloan 1> SELECT COUNT(*) FROM agreements 2> ----------- 363 (1 row affected) 1> SELECT MAX(agreement_id) FROM agreements 2> ----------- 365 (1 row affected) 1> exit See if this works...since it has worked for me but again it quite customized utility provided..... |
|
|||
|
Re: shell script
i cannot understand the following shellscript,i will be thankfull if tell me the answer.
write a shell script that receive a login name interactively and display the details of the users on the display screen in an easily understandamle format |
|
|||
|
Re: shell script
well u can try this
I guess it should work. ========================================== echo "Enter username : " read uname echo "The username entered is $uname" echo `finger $uname` ========================================== Let me know if it works. |
|
|||
|
Re: shell script
Quote:
hi, you all about 1)unix shell 2)shell scripting3)databasefile. othere simple shell scripting to write useing cut,sort,and grep using. |
| The Following User Says Thank You to praphulpandit For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| QTP - VB script | aromalis | QTP | 7 | 10-11-2007 11:37 AM |
| Popular Shell in Linux | norman | Unix/Linux | 1 | 09-25-2007 08:25 AM |
| Script Error | sharifhere | Unix/Linux | 2 | 01-16-2007 07:38 AM |
| About Shell Layer Management in UNIX | nancyphilips | Unix/Linux | 2 | 12-14-2006 08:51 AM |
| Difference in UNIX Shell | scott | Unix/Linux | 2 | 07-23-2006 12:40 PM |