delphi - How to ignore some parameters in TQuery -


if have sql statement below

select * mytable cid = :vcid , datatype = :vdatatype 

and use tquery data below

aquery.parambyname('vcid').value := '0025'; aquery.parambyname('vdatatype').asinteger := 1; 

but how can ignore "cid" key sql like

select * mytable datatype = :vdatatype 

i've try below synctax, failed

aquery.parambyname('vcid').value := '%'; aquery.parambyname('vdatatype').asinteger := 1; 

please me out, thank you.

the best option use separate queries:

aqueryboth.sql.text := 'select * mytable cid = :vcid , datatype = :vdatatype'; ... aqueryboth.parambyname('vcid').value := '0025'; aqueryboth.parambyname('vdatatype').asinteger := 1; 

aquerydatatype.sql.text := 'select * mytable datatype = :vdatatype'; ... aquerydatatype.parambyname('vdatatype').asinteger := 1; 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -