![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| oracle connection from shell script | DILEEP410 | Shell Programming and Scripting | 4 | 07-01-2009 03:19 AM |
| Oracle database connection pools setting | skully | Oracle Updates (RSS) | 0 | 06-02-2008 04:04 AM |
| Oracle 9i ODBC connection | jkuchar747 | Windows & DOS: Issues & Discussions | 3 | 04-15-2008 03:10 AM |
| unix to unix serial connection question | typsam | IP Networking | 1 | 10-17-2002 05:39 PM |
| shell script- oracle connection problem | nattynatty | Shell Programming and Scripting | 4 | 08-14-2002 10:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Unix + oracle connection
Requirements:
Using a shell script I have to check the 4 values from a table in Oracle and then store the result as "Y" in a Unix variable if the values are desired and "N" if the values are not desired. Explanation: There is a table abc in oracle which has 4 fields. if all the four values comes out to be 1 then i want to assign a Unix variable "result" as "Y". If even one of the values is "0" then i want to assign the UNIX variable "result" as "N". All this has to be done using UNIX shell scripting. Request the experts to come ahead and help me. Decci |
|
||||
|
One way - Code:
sqlplus -s username/passwd@oracledb<<EOF set head off set feedback off spool tmp.tmp select fld1 + fld2 + fld3 + fld4 from abc; spool off exit EOF result=0 grep -q '4' tmp.tmp if [[ $? -eq 0 ]] ; then result=1 fi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|