Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Strange behaviour of Scalar Subquery
I have a table:
create table c (
adate date,
pk number
)
assuming the columns having proper non-null values, the following update returns error:
update c
set adate=(select min(adate) from c) + 1;
ora-00933 sql command not properly ended
However, this update command executed successfully(i.e. I just swap the operands of + operator) !!
update c
set adate=1+(select min(adate) from c) ;
xxx rows updated
Anyone know why there is a difference? My guess may be the type of the scalar subquery may not be DATE (implicity converted to VARCHAR) in the first case because Oracle evaluates + operator from left to right and converts date to char implicitly. Am I correct? Received on Wed Jan 05 2005 - 13:23:57 CST
![]() |
![]() |