Virtualquery returns empty dataset when WHERE compares string values

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
davort
Posts: 25
Joined: Sat 20 Jan 2007 14:37

Virtualquery returns empty dataset when WHERE compares string values

Post by davort » Tue 10 Sep 2019 09:00

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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Virtualquery returns empty dataset when WHERE compares string values

Post by ViktorV » Thu 12 Sep 2019 06:42

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.

Post Reply