Page 1 of 1

Virtualquery returns empty dataset when WHERE compares string values

Posted: Tue 10 Sep 2019 09:00
by davort
Hello,


I have TIBCQuery (qPAP) that returns some partner's data, and would like to filter this data out using TVirtualQuery:

Code: Select all

select 
*
from qPAP

where 
(ident = :IDENT) and 
(sifra <> :SIFRA)
qPAP's field IDENT is defined as:

Code: Select all

    object qPAPIDENT: TStringField
      DisplayLabel = 'ID za DDV'
      FieldName = 'IDENT'
      ReadOnly = True
      FixedChar = True
    end
and SIFRA as:

Code: Select all

    object qPAPSIFRA: TIntegerField
      DisplayLabel = #352'ifra FAW'
      FieldName = 'SIFRA'
      DisplayFormat = '0'
    end
Parameters:

Code: Select all

    ParamData = <
      item
        DataType = ftString
        Name = 'IDENT'
        ParamType = ptInput
        Size = 20
        Value = 'SI30154553'
      end
      item
        DataType = ftInteger
        Name = 'SIFRA'
        ParamType = ptInput
        Value = 1
      end>
The parameter's values are ok, the data IS present in the original query, but the VirtualQuery returns empty dataset.

If I use only integer parameters, I get the data, but I need to compare character data.

How do I do it?

Thanks,

Davor.

Re: Virtualquery returns empty dataset when WHERE compares string values

Posted: Thu 12 Sep 2019 06:42
by ViktorV
Unfortunately, we cannot reproduce the problem in our environment based on the data you provide.
Please, compose a small sample demonstrating the described behavior and send it to us using the contact form https://www.devart.com/company/contactform.html including scripts for creating and populating database objects.