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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: simple sql problem

RE: simple sql problem

From: Tatireddy, Shrinivas (MED, Keane) <Shrinivas.Tatireddy_at_med.ge.com>
Date: Tue, 04 Dec 2001 00:31:02 -0800
Message-ID: <F001.003D44E0.20011204000543@fatcity.com>

b'coz you have to type select * from v\$instance;"

you are passing arguments from shell. You have to escape $ like \$

HTH -----Original Message-----
Sent: Tuesday, December 04, 2001 3:50 AM To: Multiple recipients of list ORACLE-L

 Even using like this:-

echo "select * from v$instance;" | sqlplus system/manager

gives me the error :-

SQL> select * from v                      
              *                           
ERROR at line 1:                          
ORA-00942: table or view does not exist

Though I can do the same sql statement from inside sqlplus with ease, so why does it give table or view does not exist?

I am confused ..

rgds,

--

On Mon, 03 Dec 2001 21:50:17  
 Ross Collado wrote:

>I don't believe SQLPlus will let you run a SQL statement in the command
line
>itself. As you can see in Usage:, it doesn't have an option for this.
>However, if you insist on running SQL statements in the command line
itself,
>you can probably do something like (only in Unix):
>
>sqlplus -s scott/tiger << !
>select * from emp;
>!
>
>or
>
>save your select * from emp; to a sql file and do :
>sqlplus -s scott/tiger @myfile.sql
>
>hth
>Ross
>
>> -----Original Message-----
>> From: Viraj Luthra [mailto:viraj999_at_lycos.com]
>> Sent: Tuesday, 4 December 2001 16:11
>> To: Multiple recipients of list ORACLE-L
>> Subject: simple sql problem
>>
>>
>> Hello all,
>>
>> Why cannot I do :-
>>
>> sqlplus -s scott/tiger select * from emp;
>>
>> or sqlplus -s scott/tiger "select * from emp;"
>>
>> Both the cases I get :-
>>
>> Usage: SQLPLUS [<option>] [<user>[/<password>] [@<host>]]
>> [@<startfile> [<parm1>] [<parm2>] ...]
>> where <option> ::= { -s | -? }
>> -s for silent mode and -? to obtain version number
>>
>>
>> What is wrong above? I need to run the query from command
>> line. How do I modify this :-
>>
>> sqlplus -s scott/tiger select * from emp;
>>
>>
>> Rgds,
>>
>>
>>
>> --
>> Please see the official ORACLE-L FAQ: http://www.orafaq.com
>> --
>> Author: Viraj Luthra
>> INET: viraj999_at_lycos.com
>>
>> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>> San Diego, California -- Public Internet access / Mailing
Lists
>> --------------------------------------------------------------------
>> To REMOVE yourself from this mailing list, send an E-Mail message
>> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>> the message BODY, include a line containing: UNSUB ORACLE-L
>> (or the name of mailing list you want to be removed from). You may
>> also send the HELP command for other information (like subscribing).
>>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Ross Collado
> INET: Ross.Collado_at_techpac.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Viraj Luthra INET: viraj999_at_lycos.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tatireddy, Shrinivas (MED, Keane) INET: Shrinivas.Tatireddy_at_med.ge.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Tue Dec 04 2001 - 02:31:02 CST

Original text of this message

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