Doubt related UPPER with spatial

Hello friends:
I have the following doubt related to UPPER.

-- This sql does not run right
 SELECT tb1.id, upper('lote'),
              UPPER(tb2.FEATURE_TYPE),
              tb2.ID,
              tb2.feature_type,
              tb2.GEOMETRY
  FROM  CH   tb1,
              LOT tb2
 WHERE SDO_RELATE(tb2.GEOMETRY,tb1.GEOMETRY,'mask=inside querytype=WINDOW')
= 'TRUE'
      and UPPER(tb2.FEATURE_TYPE) = UPPER('lote')

-- This one run right
  SELECT tb1.id, upper('lote'),
              UPPER(tb2.FEATURE_TYPE),
              tb2.ID,
              tb2.feature_type,
              tb2.GEOMETRY
  FROM  CH   tb1,
              LOT tb2
 WHERE SDO_RELATE(tb2.GEOMETRY,tb1.GEOMETRY,'mask=inside querytype=WINDOW')
= 'TRUE'
      and tb2.FEATURE_TYPE = 'lote';

        ID UPPER('LOTE') UPPER(LOT_F.FEATURE_TYPE)
ID          FEATURE_TYPE
----------- -------------
----------------------------------------------------------------------
----------- ----------------
         86 LOTE
 LOTE
 92         lote
         93 LOTE
 LOTE
91         lote

The content of the column feature_type is:
FEATURE_TYPE
----------------------------------------------------------------------
lote
lote
lote
What is wrong ?
Why UPPER does not work in this case?
Any idea ?


Regards
Eriovaldo


--
http://www.freelists.org/webpage/oracle-l


Other related posts: