On Mon, Jun 25, 2001 at 02:24:21PM -0400, Chas Owens wrote:
> 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 \).

Yes.

 
> The shell saw $session so it tried to replace it with the enviromental
> variable $session (which was empty) so Oracle saw:

No, it tried to replace it with the variable $session.  Shells have normal
variables as well as environmental ones.


> 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);

Yes.

 
> 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.

Yes, though "passes" would be a better term than "outputs".


This type of thing always makes me wish for a list form of qx//, akin to the
list forms of exec and system.  Something along the lines of:

    list_qx("sqlplus", 'select count ... v$session ...');

Of course, you can get the equivalent in a variety of ways, but nothing
quite beats a core function (be it builtin, or in a core module).
 

Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to