Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Compare variables / NULL syndrome
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