On 25 Jun 2001 10:14:57 -0800, Michael Fowler wrote:
> On Mon, Jun 25, 2001 at 02:09:59PM -0400, Chas Owens wrote:
> > @active = qx(
> > sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-!
> > select count(distinct(process)) ACTIVE from v\\\$session
> > where last_call_et < 60 and
> > process in (select ltrim(rtrim(to_char(process_id) )) from
> > session_list);
> > quit
> > !
>
> Oh, I wasn't aware this was going through the shell (I hadn't been paying
> attention to the discussion). That's what's doing the interpolation of
> $session.
>
>
> Michael
> --
> Administrator www.shoebox.net
> Programmer, System Administrator www.gallanttech.com
> --
>
Let me see if I have this straight:
Perl was ignoring $session because of the \ and then passing the output
to the shell (stripping the \).
The shell saw $session so it tried to replace it with the enviromental
variable $session (which was empty) so Oracle saw:
select count(distinct(process)) ACTIVE from v
where last_call_et < 60 and
process in (select ltrim(rtrim(to_char(process_id) )) from
session_list);
Hence the error. If this is the case then using "v\\\$session" should
result in:
Perl outputs v\$session
Shell outputs v$session
Oracle sees what it expects.
--
Today is Sweetmorn, the 30th day of Confusion in the YOLD 3167
Wibble.