tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY:  Problem with script
@ 2001-06-06 11:17 Mark Bowman
  0 siblings, 0 replies; only message in thread
From: Mark Bowman @ 2001-06-06 11:17 UTC (permalink / raw)
  To: tru64-unix-managers

Many thanks to all that replied to my request for help.

1. For those people who do not use sql the v$session is a name of table in 
Oracle.

2. I have tried to use single, double quotes, and v\$session; none of which 
worked.

Background
Looks like the v$session is getting interpreted by the ksh shell as a 
variable. Now I know whats going on, here is the working script.

#!/bin/ksh
TABLE='v$session'                # The tablename in single quotes.
ORACLE_SID=CUST export ORACLE_SID
VALUE=`sqlplus -silent "system/manager" <<END
select USERNAME, OSUSER from $TABLE;
exit;
END`
if [ -z "$VALUE" ]; then
   echo "NO rows returned from database!"
   exit 0
else
   echo $VALUE
fi

----
I have a short script that shows the number of connection to our database, 
for some reason it dosn't read the whole line. It drop the v$session to just 
'v' any ideas as to what is wrong?

Unix Tru64 Version 5.0a (Version M-11/16/88)




_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-06-06 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-06 11:17 SUMMARY: Problem with script Mark Bowman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox