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

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -