How to add parameters in Tdfquerry

Asked

Viewed 357 times

2

How to add a new parameter in TDFQuerry?, The image below shows the parameters filled, and in case I need to know how to add another.

inserir a descrição da imagem aqui

3 answers

2

Adding parameters is automatically added based on script written in tab SQL Command

See this Example:

SELECT IDADE, SEXO, ETC 
  FROM PACIENTES
 WHERE PACIENTE = :PACIENTE
   AND NOME     = :NOME

Following this example will be presented the 2 parameters, PACIENTE and NOME.

0

Hello.

In this case, simply add in the SQL command (SQL command tab) the name of the desired parameters. For example:

SELECT * FROM TESTE WHERE ID1 = :PARAM1 and ID2 = :PARAM2

Respecting this nomenclature, Firedac itself is responsible for including the new parameters, it is up to you to specify the other information of the same (type, size, etc...).

0

There are two ways to do this:

One is static, informing on the property Params of date set.

The other is through the same line of code, through the command FDQuery.ParamByName('INFORME_O_SEU_PARAMETRO').

I particularly like the second, I get less stuck to setting the data set.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.