operator opand incompatible with string

ziller

Member²
hello,

i use a toracledataset with this sql :

Code:
select 	d.cod_doc,d.lib_doc,de.cod_elp,de.cod_anu
from	ctu2_doc_elp de, ctu2_document d
where 	de.cod_anu = :cod_anu
and	d.cod_doc = de.cod_doc
and then i use this component like this :

Code:
if not qry_DOC_ELP_SEL.Active then
      with qry_DOC_ELP_SEL do begin
        Close;
        SetVariable('COD_ANU', g_COD_ANU);
        Open;
        Filtered := true;
        Filter := '(COD_ANU=''2003'') and COD_ELP=''AEZ''';  // ==> ERROR
        // it_ELP_DOC.FullExpand;
      end;
after the filter := ...; i get the error operator opand incompatible with string

ps : i have added the filtered := true; and filter := ...; in order to reproduce the behavior of dream-company TDCDBRelInfoSet component.

thanks for your help.
 
The filter follows the Pascal rule that "AND" takes precedence over "=", so you will have to use parentheses:

Filter := '(COD_ANU=''2003'') and (COD_ELP=''AEZ'')'
 
Back
Top