plsql - Oracle Forms 6i Comparing Fields -


i have form 2 fields type char 128 each trying compare contents of these fields. not getting proper comparison done. when both fields have same data still saying both fields not match.

begin  if(ltrim(rtrim(:field1)) = ltrim(rtrim(:field2)))then  show_message('fields match'); else  show_message('fields not match'); end if;  end; 

the problem stated in oracle null not equal null. in oracle comparison null false. can work around using nvl in case should prefer instead use null this:

begin    if (ltrim(rtrim(:field1)) = ltrim(rtrim(:field2)))    or (:field1 null , :field2 null)    show_message('fields match');    else    show_message('fields not match');    end if;  end; 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -