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

Home -> Community -> Usenet -> c.d.o.misc -> SQL*Plus bug??

SQL*Plus bug??

From: Tim Harris <harrist_at_ucs.orst.edu>
Date: Fri, 26 Oct 2001 17:54:22 -0700
Message-ID: <3BDA05BE.98AA87D3@ucs.orst.edu>


On SQL*Plus: Release 8.1.6.0.0

Can anyone explain to me why I get this error with the following SQL statement...

  1 select 'x' from dual
  2* where 4 = (select 2 from dual) + 2

but by swapping the order of the operands it works?

  1 select 'x' from dual
  2* where 4 = 2 + (select 2 from dual)

Actually, what I really need to do is this

  1 select 'x' from dual
  2* where 4 = (select 2 from dual) + (select 2 from dual)

which also results in a nasty error.

I learned from algebra that I can balance equation by doing this

  1 select 'x' from dual
  2* where 4 - (select 2 from dual) = (select 2 from dual)

and THIS works fine!?! (at least I have a workaround)....

In fact, I can even do this

  1 select 'x' from dual
  2* where (select -2 from dual) + (select 4 from dual) = (select 2 from dual)

and it works just fine..
Why on earth is the first example screwy?? (this is the stripped down version to illustrate the problem...

   you don't want to see the nasty full version of the code I'm working on! :)

any comments appreciated
-Tim Harris
Oregon State U. Received on Fri Oct 26 2001 - 19:54:22 CDT

Original text of this message

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