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 -> Compare variables / NULL syndrome

Compare variables / NULL syndrome

From: Sam Jordan <sjo_at_spin.ch>
Date: Mon, 17 May 1999 13:48:14 +0000
Message-ID: <37401E1E.2D30E5C3@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 Mon May 17 1999 - 08:48:14 CDT

Original text of this message

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