Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread CustomFunction returning empty string
Thu, Dec 2 2021 9:04 AMPermanent Link

Guilherme Martins

Quorum Consultoria Ltda

Avatar

I have a custom function that sometimes is returning a empty string and I can´t match the result.
Here is the code to reproduce the problem:

begin
 Engine.Functions.CreateFunction(ftString,'ReturnEmpty');
end;

procedure MyForm.CustomFunction(Sender: TObject;
 const FunctionName: String; FunctionParams: TDBISAMParams;
 var Result: Variant);
begin
  if (AnsiCompareText(FunctionName,'ReturnEmpty')=0) then Result:='';
end;

select * from table where ReturnEmpty() = ''  >>> returns no records
select * from table where ReturnEmpty() is null  >>> returns no records
select * from table where length(ReturnEmpty())=0  >>> returns ALL records

Can anybody help me?
Thanks a lot,
Guilherme Martins
Image