![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting to oracle database from shell script | satyakiran | Shell Programming and Scripting | 8 | 07-03-2009 03:22 PM |
| Connecting to DB2 database on Mainframe and Querying DB | developncode | UNIX for Advanced & Expert Users | 2 | 05-05-2008 11:01 PM |
| Install Guide: Oracle Database 11g Release 1 on Oracle Enterprise Linux 5 | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 05:10 AM |
| error connecting database from perl | DILEEP410 | Shell Programming and Scripting | 4 | 09-17-2007 08:03 AM |
| Connecting to a database via UNIX | penfold | UNIX for Advanced & Expert Users | 1 | 03-05-2005 02:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Connecting to Oracle Database
if[ $action = 'export' ];
sql="select username from dba_users where username = '$FromUser';" check_FromUser=`ExecSql "$sql"` I want to connect to Oracle database & check the users in the database, store the value in check_FromUser. First how to connect to Oracle database from the shell script ? Appreciate your reply in this regard...... Thanks |
|
|||||
|
Take a look at this thread and search for others using the search function.
|
|
||||
|
Just a Small Question
Hi Pals..
I have a shell script Which is calling a .sql file. Code:
#!/bin/ksh sqlplus -s userID/password@DB_INSTANCE @Test.sql & sqlplus -s userID/password@DB_INSTANCE << EOF exit EOF The Test.sql and Testsql.sh are in the same directory .. |
|
||||
|
This code may help you
#!/bin/ksh CHKLOGIN() { if sqlplus -s /nolog <<! >/dev/null 2>&1 WHENEVER SQLERROR EXIT 1; CONNECT $1 ; exit; ! then echo OK else echo NOK fi } LOGIN_ID="$1" (This will take login/pwd u have to give it as 'scott/tiger' from cmd promt) while [ "$LOGIN_ID" = "" -o `CHKLOGIN "$LOGIN_ID" "DUAL"` = "NOK" ] do if [ "$LOGIN_ID" = "" ];then echo "Enter Login Userid/Passwd : \c" read LOGIN_ID else echo "Enter Login Userid/Passwd : \c" LOGIN_ID="" fi done if sqlplus -s $LOGIN_ID @$TOP_path/sql/xxx.sql(or any package) > $LOGFILE then echo "Any thing u can do or can display sucessfull" >> $LOGFILE else echo "Installation of sql script is not successful" >> $LOGFILE echo "Aborting......" >> $LOGFILE exit 1 fi |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|