![]() |
|
|
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 |
| select count(*) in sqlplus into variable unix shell | struggle | UNIX for Dummies Questions & Answers | 2 | 03-26-2008 11:12 PM |
| passing unix variable to sqlplus without a file name | sakthi.abdullah | UNIX for Advanced & Expert Users | 3 | 12-12-2006 06:35 AM |
| Sqlplus | antkiu | Shell Programming and Scripting | 4 | 09-14-2006 01:36 AM |
| How to pass unix variable to SQLPLUS | chiru | UNIX for Advanced & Expert Users | 1 | 06-10-2006 03:11 AM |
| How to pass variable to SQLPLUS in a ksh script? | rwunwla | Shell Programming and Scripting | 6 | 05-25-2006 06:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Using a variable in sqlplus
Hello,
I'm trying to write a script that will loop a sql statement through an external list. Basically, the script enters a loop and runs the sql statement for each entry in the list file. Currently, the script will stop at a cursor where I can then manually enter the SQL statment. This is what I have so far: Port_count.ksh Quote:
Quote:
Thanks, Chris |
|
||||
|
Quote:
Thank you for your reply. I have tried what you suggested and still receive the same issue, with a syntax error that | is unexpected. |
|
|||||
|
how about: Code:
#!/bin/ksh
PRTFLIST='/home/oracle/PortConversion/tradePort.list'
DATADIR="$(dirname ${PRTFLIST)"
# Source the login information
. $HOME/Dear/jobs/DRU/login_DRU.ksh
cd /home/oracle/chris/PortConversion
#get the row count for each portfolio
while read prtf; do
echo "select count (*) from dear_trade_snapshot where id_prtf_stars = '$prtf'"
done < "${PRTFLIST}" | \
$ORACLE_HOME/bin/sqlplus -s $DBO_USER/$DBO_PASS </dev/null
|
|
||||
|
vgersh99, I gave that a shot, and now i see that it connects and disconnects to sqlplus, however I don't think its running the script as it happens instantaniously (sp?) and nothing is printed between the connect and disconnect. I did remove the -s as well.
|
|
|||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|