Firedac -How to use same FDquery in more than one bank?

3

I heard that the FD has a program for two different database managers using same FDQuery , that is, it would give the two SQL's of each bank in the same FDQuery ... or something like that ...

Does Aguem have any tutorials for this?

    
asked by anonymous 21.10.2016 / 21:29

1 answer

4

Hello, yes it is possible. The component to be used is FDLocalSQL , where you would basically do the SELECT of a FDQuery . In practice, it works like this:

  • Enter a FDLocalSQL component;
  • Enter the datasets linked to the N banks you want, each one with their proper SQL's;
  • Turn on the LocalSQL property of each dataset in the FDLocalSQl component;
  • Enter a new FDConnection with Driver SQLLite ;
  • Enter a new FDQuery into the form;
  • Turn on FDLocalSQL and new Query on FDConnection of item 4.0;
  • In this last FDQuery , enter SQL by referencing each Query as being a table. Ex: SELECT NOME FROM FDQUERY1 JOIN FDQUERY2 ON (FDQUERY1.CAMPO = FDQUERY2.CAMPO) ;
  • Open the last dataset.
  • 21.10.2016 / 21:58