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: Problem: Like-Statement and NULL-Fields

Re: Problem: Like-Statement and NULL-Fields

From: Matthias Rogel <rogel_at_web.de>
Date: Tue, 22 Oct 2002 08:58:20 +0200
Message-ID: <ap2sup$q2d15$1@ID-86071.news.dfncis.de>


Hi,

of course
SELECT * FROM Users WHERE Flags is not null and flagsNOT LIKE 'D%'; would do, but you said, you can't change the select-statement

so, change the table-def.
a. rename users to users_
b1. create view users as select * from users_ where flags is not null; or
b2. create view users as select bla1, bla2, ..., blam, nvl(flags, ' ') as flags from users_;

in case b2 U might have to use instead-of-triggers for dml on users

matthias

"Volker Schmid" <Info_NoSpam_at_Inspirant.de> schrieb im Newsbeitrag news:ap2r8k$ns3$1_at_news.online.de...
> Hi,
>
> I try to get a recordset with the following statement:
>
> SELECT * FROM Users WHERE Flags NOT LIKE 'D%';
>
> The Problem ist, that I don't get a row if the Flags-column in this row is
> NULL. Even if I set the Flags-value of a row to '' (double ') Oracle
turn's
> this to NULL. If I define the Flags-column with NOT NULL I always have to
> set this value. Trying to set a Default-Value failed.
>
> I can't change the SELECT-Statement but I'm able to change the
> table-definition. How can I get rid of this problem?
>
> Thank you,
>
> Volker
>
>
Received on Tue Oct 22 2002 - 01:58:20 CDT

Original text of this message

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