Oracle PL/SQL string compare issue -
1). Hello, I have the following Oracle PL / SQL code that you can get confused with people's perspective: It is very clear that two strings str1 and str2 are not the same, but why 'two strings are not identical' were not printed? Is Oracle one more common way to compare two strings? As Phil has written, a null is considered as an empty string, Is not even equal or uneven. If you are expecting an empty string or tap, then you have to handle those people with In relation to faucet comparison: , using is a condition that evaluates to UNKNOWN, works almost like FALSE. For example, with a condition a quote statement that does not give a line in the WHERE section that evaluates for UNKNOWN. However, that is different from a condition FALSE for evaluating UNKNOWN will evaluate UNKNOWN further action to evaluate an UNKNOWN status. Thus, assumes no wrong, but evaluates unknown, unknown. The went provides a reference table Oracle: NVL () :
DECLARE str1 varchar2 (4000); Str2 varchar2 (4000); BEGIN str1: = ''; Str2: = 'SDD'; - Provide an optional tap value that is not present in your data: If (NVL (Straw, 'X')! = NVL (Straw2, 'Y')) then DBMS_output.pat_line ('two strings are not equal') ; end if; End; /
IS null Rate tap than the
is not null to
TRUE or
FALSE . However, all other than
UNKNOWN , do not
An evaluation of the position value - ------------- -------------------------- iS nULL 10 is wrong tap 10 is not really an iS faucet is not right faucet lie = nULL 10 Unknown one! = Faucet 10 unknown one = faucet nose unknown one! = Null unknown unknown one = 10 zero unknown! I also found out that we should not always be evaluated as zero when pl / sql is considered empty string:
P> Oracle Database currently recognizes zero values with the length of zero. However, this will not be true in future releases, and Oracle recommends that you do not consider empty wires as faucet.
Comments
Post a Comment