Hello,
In s stored proc I have a string declared as an empty string (2 single-quotes with no space in between):
ErrMsgEx varchar2(5000) := '';
later on in the code it checks if the error message is still empty, then process finished OK... as follows:
if 1 > Length(LTrim(ErrMsgEx)) then
ErrMsgEx := 'Process sSuccessful';
else
ErrMsgEx := ErrMsgEx || 'Process completed with errors';
end if;
in the code line in boldface above I've also tried the following variations of the same logic:
if ErrMsgEx = '' then
if 0 = Length(ErrMsgEx) then
if 0 = Length(Trim(ErrMsgEx)) then
if 1 > Length(ErrMsgEx) then
if 1 > Length(Trim(ErrMsgEx)) then
but running thru the debugger it shows that ErrMsgEx is empty, but when the IF is evaluated, it jumps to the ELSE branch
Is the code wrong? Why is it so cumbersome to test a string for emptyness?
Thanks in advance,
Richard