Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Compare variables / NULL syndrome

Re: Compare variables / NULL syndrome

From: Tim Shute <tshute_at_nisoft.co.uk>
Date: Tue, 18 May 1999 09:16:39 +0100
Message-ID: <049F56710FD6D211B08D006097A4426B03F4B0@orion>


Sam,

Have you considered

if (NVL(var_a, '') = NVL(mytab.z, '')) and

      (NVL(var_b, '') = NVL(mytab.y, '')) and     ...
    (NVL(var_z, '') = NVL(mytab.a, '')) then

HTH
--
--
Tim Shute
Software Engineering Manager

NiSoft (UK) Limited
Unit 8, 31 Ballynahinch Road, Carryduff, BELFAST BT8 8EH Internet: www.nisoft.co.uk

Sam Jordan <sjo_at_spin.ch> wrote in message news:37401E1E.2D30E5C3_at_spin.ch...
> Hi
>
> I have a stored procedure which gets a couple of parameters.
> One job of the procedure is to find out, if in a certain table
> a row exists, where all elements match exactly the given parameters.
>
> First I have done it the following way, something like
>
> if (var_a = mytab.z) and
> (var_b = mytab.y) and
> ...
> (var_z = mytab.a) then
>
> mytab is of type 'mytable%rowtype', and it is filled previously
> by fetching an appropriate cursor.
>
> Problem: if both parameter and table element are null, then
> this comparison will result to 'not true', although both results
> are the same.
>
> Is there an easy way of doing such a comparison? Checking all
> special cases (if ((a=b)or((a is null) and (b is null))) and ...)
> leads to an awful statement.
>
> bye
> --
> Sam Jordan
Received on Tue May 18 1999 - 03:16:39 CDT

Original text of this message

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