Sounds like an april fool, but I wonder what is + ‘x’ supposed to do
SQL> select + 'x' from dual;
+
-
x
it does not convert to number as 0 + ’1′ would do
Sounds like an april fool, but I wonder what is + ‘x’ supposed to do
SQL> select + 'x' from dual;
+
-
x
it does not convert to number as 0 + ’1′ would do
Very interesting. Obviously the parser is ignoring the + operator in this instance.
select dump(0) zero, dump(+’x') plus_x, dump(‘x’) x, dump(+’0′) plus_zero_char, dump(+0) plus_zero from dual;
ZERO PLUS_X X PLUS_ZERO_CHAR PLUS_ZERO
—————- —————– —————– —————- —————-
Typ=2 Len=1: 128
Typ=96 Len=1: 120
Typ=96 Len=1: 120
Typ=96 Len=1: 48
Typ=2 Len=1: 128
Unfortunately SELECT – ‘x’ FROM DUAL; doesn’t work so we may never know what a negative character would be.
works also for date, timestamp and interval – literals:
doesn’t seem to be documented though
while this works :
why shouldn’t this work ?
if Oracle knows that +x=x, it should also know that -x=(-1)*x, right?
I would think parser bug, probably stripping optional leading unary + for numerics. Also ‘works’ on columns and ( ).
SQL> SELECT +(+(+’z'))||+dummy FROM dual;
+(
–
zX
nice !!!