![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL statement output to Log file-How? | vsubbu1000 | HP-UX | 1 | 08-21-2007 08:40 PM |
| grepping the output of a command in an if statement | hcclnoodles | Shell Programming and Scripting | 3 | 06-29-2007 04:00 AM |
| Supress ' quotes in a select statement inside Shell Script | mahabunta | Shell Programming and Scripting | 1 | 12-14-2006 03:29 PM |
| get the output of unix script in windows | csrope | Shell Programming and Scripting | 1 | 06-27-2005 09:39 PM |
| Pipe SQL select statement results to script | houtakker | UNIX for Dummies Questions & Answers | 6 | 10-31-2003 10:20 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Want to use the output of Select statement in Unix script
Hi,
I have a UNIX script which calls SQL Select statement: Now i want to use the output of that select statement within my UNIX script so as to call different shell script depending upon the output of the select statement. Can anyone help me in this regard. TIA Akhil Goel |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
.....if you post the contents of the script that you're using. Cheers ZB |
|
#3
|
|||
|
|||
|
Want to use the output of Select statement in Unix script
Please have a look on the below example so as to let you know what exactly i need...
Shell Script: echo " You are in shell script" # Start of SQL str=`sqlplus sa/sa <<eof! set verify off set heading off set feedback off Select * from table_case; exit eof! ` # End of SQL i would like to have the output of the above SQL query here.. # display result of above query echo ??? i dont want to use stored proc |
|
#4
|
|||
|
|||
|
UNIX and SQL
Also see if the below example is possible: can the variable of shell scripts (e.g. count) be accessible in SQL block, If yes then how?
Shell Script: read count # Start of SQL str=`sqlplus sa/sa <<eof! set verify off set heading off set feedback off Select * from table_case where id = $count; exit eof! ` # End of SQL |
|
#5
|
|||
|
|||
|
If you want to send values to a SQL script as a command line parameter then call your sqlplus command with arguments as follows
sqlplus username/password argument1 argument2 .. and within the sqlplus commands refer to the arguments as positional parameters as &1, &2 .. Also if you want to send values from the sql scripts back into the calling environment you would have to write PL/SQL blocks coded into sql scripts which can communicate values from the sqlplus exeuctions as bind_variables. Then you can use the exit command as follows within the PL/SQL block and pass the bind variable back to the calling environment. EXIT :BIND_VAR; Jerardfjay |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|