Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus using Here document does not recognize v$ view ?

Re: sqlplus using Here document does not recognize v$ view ?

From: Igor Laletin <ilaletin_at_usa.net>
Date: 17 May 2004 17:40:28 -0700
Message-ID: <f9226414.0405171640.5b98164f@posting.google.com>


tedchyn_at_yahoo.com (Ted Chyn) wrote in message news:<44a19320.0405171023.72ad9ac5_at_posting.google.com>...
> dear sir,
>
> why following sqlplus command using here document did not recognize
> the
> v$database(case 1). it worked in case 2 when login directly.

Shell (whichever one you use) substitutes '$database' with the value of its variable 'database'.  

> my question : How to rectify case 1 to ensure unix here document works ?

Insert backslash before $.

Cheers,
Igor  

> thanks ted
>
>
> =====
> 1. case 1
>
> SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 -
> 64bit Production
> With the Partitioning, OLAP and Oracle Data Mining options
> JServer Release 9.2.0.3.0 - Production
> /export/home/oracle/script > sqlplus -s /nolog <<eof
> > connect system/huni123_
> > select name from v$database;
> > exit
> > eof
> Connected.
> select name from v
> *
> ERROR at line 1:
> ORA-00942: table or view does not exist
> ======================
> 2. case 2
>
> /export/home/oracle/script > sqlplus system
>
> SQL*Plus: Release 9.2.0.3.0 - Production on Mon May 17 13:20:07 2004
>
> Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
>
> Enter password:
>
> Connected to:
> Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
> With the Partitioning, OLAP and Oracle Data Mining options
> JServer Release 9.2.0.3.0 - Production
>
> SQL> select name from v$database;
>
> NAME
> ---------
> EASDEV
Received on Mon May 17 2004 - 19:40:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US