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 -> Re: Weird Query

Re: Weird Query

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Mon, 01 Aug 2005 12:38:53 +0200
Message-ID: <42edfcd1$0$6988$9b4e6d93@newsread2.arcor-online.net>


Marian Aldenhövel schrieb:
> Hi,
>
> Behold the following SQL-Plus-Session, run against an Oracle 9i (Patch 2)
> Server:
>
> > SQL> select pp_lock from cbr_385120060b39d42d8;
> >
> > PP_LOCK
> >
> ----------------------------------------------------------------------------
>
> > STEFANWIMMER\goit consulting\658.1_at_STEFANWIMMER
> >
> >
> > SQL> select pp_lock from cbr_385120060b39d42d8 where pp_lock = '';
> >
> > Es wurden keine Zeilen ausgewählt
> >
> > SQL> select pp_lock from cbr_385120060b39d42d8 where pp_lock <> '';
> >
> > Es wurden keine Zeilen ausgewählt
> >
> > SQL> select pp_lock from cbr_385120060b39d42d8 where pp_lock is null;
> >
> > Es wurden keine Zeilen ausgewählt
>
> So the table _does_ have exactly one record. Which is not returned in
> any of the queries that select specific values of PP_LOCK.
>
> I am not an Oracle-Expert by far, but this still puzzles me. Any
> explanations?
>
> Ciao, MM

What exactly do you think is wrong in the results? You know, the '' is equivalent to NULL.
You know, to proof , whether value is null , should be used IS NULL/IS NOT NULL ( all other kinds of comparisons ,i.e. = NULL ,<> NULL etc. will be equivalent to FALSE in where clause and leads to no rows returning).

The first query delivers the 1 existing row with a *NOT NULL* value for pp_lock ('STEFANWIMMER\goit consulting\658.1_at_STEFANWIMMER'), all following have WHERE CLAUSE evaluated to FALSE and as result no rows were returned.

Best regards

Maxim Received on Mon Aug 01 2005 - 05:38:53 CDT

Original text of this message

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