RE: simple sql problem

2001-12-04 Thread Viraj Luthra
hth Ross -Original Message- From: Viraj Luthra [mailto:[EMAIL PROTECTED]] 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

RE: simple sql problem

2001-12-04 Thread hemantchitale
) Subject: RE: simple sql problem

RE: simple sql problem

2001-12-04 Thread Tatireddy, Shrinivas (MED, Keane)
:[EMAIL PROTECTED]] 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

RE: simple sql problem

2001-12-04 Thread DENNIS WILLIAMS
Viraj - Your SQL isn't terminated. You need to end your SQL with either a semicolon or a / on the next line. Jared - Thanks for passing along this technique. Dennis Williams DBA Lifetouch, Inc. [EMAIL PROTECTED] -Original Message- Sent: Tuesday, December 04, 2001 12:35 AM To: Multiple

Re: simple sql problem

2001-12-04 Thread Scott Shafer
From the unix command line you can run: sqlplus -s scott/tiger EOF select * from emp; EOF Viraj Luthra wrote: 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]

RE: simple sql problem

2001-12-04 Thread Kevin Lange
As Scott said, in Unix you can use Input Redirection. If you are in windows, you could always build the command as a .sql file and use the sqlplus -s scott/tiger @myfile.sql Command. -Original Message- Sent: Tuesday, December 04, 2001 10:01 AM To: Multiple recipients of list ORACLE-L

RE: simple sql problem

2001-12-04 Thread Reardon, Bruce (CALBBAY)
After testing prompted by Jared's reply, you can use 1 of the 2 alternatives from Windows. That is, under windows the following works: echo select * from dual; | sqlplus scott/tiger@abcd I often use this type of syntax under NT to (say) log the time as below, but had never thought to try it

Thanks: simple sql problem - 1 more problem

2001-12-04 Thread Viraj Luthra
Thanks to all who responded, Appreciate it. The grok approach was not working so had to go with the following one. Now just 1 more problem is that how I do I set the environment, say if I want to do set head off, in the following command can I do that? The following command I had to do :-

simple sql problem

2001-12-03 Thread Viraj Luthra
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 | -? }

Re: simple sql problem

2001-12-03 Thread hemantchitale
: CHITALE Hemant Krishnarao/Prin DBA/CSM/ST Group) Subject: simple sql problem

RE: simple sql problem

2001-12-03 Thread Ross Collado
: 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

Re: simple sql problem

2001-12-03 Thread Jared Still
The way you're doing it sqlplus is trying to parse the SQL as a command line argument, which will not work. Try these: 1. echo select * from dual; | sqlplus scott/tiger 2. sqlplus scott/tiger EOF select * from dual; EOF Jared On Monday 03 December 2001 21:10, Viraj Luthra wrote: Hello

Re: simple sql problem

2001-12-03 Thread Viraj Luthra
Jared, Using the 2nd option:- sqlplus system/manager@orcl815 ! SELECT a.username, substr(sql_text,1,100), substr(sql_text,101,250), substr(sql_text,601,250),substr(sql_text,851,250), substr(sql_text,1101,250) FROM sys.dba_users a, v$session, v$sqlarea where parsing_user_id=user_id AND

RE: simple sql problem

2001-12-03 Thread Tatireddy, Shrinivas (MED, Keane)
of list ORACLE-L [EMAIL PROTECTED] cc: (bcc: CHITALE Hemant Krishnarao/Prin DBA/CSM/ST Group) Subject: simple sql problem Hello all, Why cannot I do :- sqlplus -s scott/tiger select * from emp; or sqlplus -s scott/tiger

RE: simple sql problem

2001-12-03 Thread Nirmal Kumar Muthu Kumaran
Title: RE: simple sql problem Hi... You cann't run sql statement in command line directly However you can in case of script file. Make the query as a script file. Then run it on SQLPLUS. -- c:\test.sql - select * from emp / exit

SOLVED: simple sql problem

2001-08-05 Thread Viraj Luthra
Hello all, Sorry I was sick, therefore not able to answer. I followed suggestions from Pulikkol, Swapna and Jon, and it works just fine now. Thanks to all for getting me out of this one. rgds, raja Get 250 color business cards for FREE! http://businesscards.lycos.com/vp/fastpath/ --

RE: simple sql problem

2001-07-31 Thread Viraj Luthra
No, I mean, if (x+y) 1, that is a value of .92 which it prints out, but I want it to print out like, 0.92, that is a 0. is concatenateed to the result. therefore, when i have, select x+y from blah I should get 90 when the value is really 90 and I should get 0.92 when the value is really

RE: simple sql problem

2001-07-31 Thread Swapna_Chinnagangannagari
Title: RE: simple sql problem Hello Raja, You can try this way 1)select x+y sum1 from blah 2)col sum1 format 09.99 3)select x+y sum1 from blah rgds swapna -Original Message- From: Viraj Luthra [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 12:31 PM To: Multiple

RE: simple sql problem

2001-07-31 Thread Amar Kumar Padhi
Title: RE: simple sql problem or, set numformat '0.99' (in sql*plus) -Original Message-From: Swapna_Chinnagangannagari [mailto:[EMAIL PROTECTED]]Sent: Tuesday, July 31, 2001 12:26 PMTo: Multiple recipients of list ORACLE-LSubject: RE: simple sql problem Hello

RE: simple sql problem

2001-07-31 Thread Pulikkol Kumar
OR SELECT LPAD(TO_CHAR(x+y),LENGTH(x+y)+1,'0') FROM BLAH

Re: simple sql problem

2001-07-31 Thread Jon Walthour
Raja: Let me put my two cents into the idea bin. How about: select decode(sign(num-1),-1,'0' || to_char(num), to_char(num)) as num from t1; Jon Walthour - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 1:10 AM Hello all,

RE: simple sql problem

2001-07-31 Thread Ramon Estevez
sql problem Hello all, If I have a situation, where I have the following:- select x+y from blah and if x+y 1, eg 5 then the output can be 5, but if x+y 1, eg, .92, then I need the output as 0.92. How do I do this? rgds, raja Get 250 color business cards for FREE! http

RE: simple sql problem

2001-07-31 Thread Swapna_Chinnagangannagari
Title: RE: simple sql problem but this will append 0 to numbers 1 (sum (a+b) 1) which is not the requirement -Original Message- From: Pulikkol Kumar [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 4:10 PM To: Multiple recipients of list ORACLE-L Subject: RE: simple sql problem

RE: simple sql problem

2001-07-31 Thread Pulikkol Kumar
Hi This will work out SELECT DECODE(SIGN(x+y-1) , 1,LPAD(TO_CHAR(x+y),LENGTH(x+y),'0'), LPAD(TO_CHAR(x+y),LENGTH(x+y)+1,'0')) FROM blah

simple sql problem

2001-07-30 Thread Viraj Luthra
Hello all, If I have a situation, where I have the following:- select x+y from blah and if x+y 1, eg 5 then the output can be 5, but if x+y 1, eg, .92, then I need the output as 0.92. How do I do this? rgds, raja Get 250 color business cards for FREE!

RE: simple sql problem

2001-07-30 Thread Amar Kumar Padhi
Title: RE: simple sql problem I believe what you meant is if it is less than one then the output should be 1. if so: select (case when x + y 1 then x + Y else 1 end) from blah; -Original Message- From: Viraj Luthra [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 9:10