How to bring the conditions entered as parameters into the SELECT result?

3

Is there any way to get the parameter values used in the SELECT clause in the WHERE result?

Example:

SELECT 
  a.*, cast(:dataIni as date) AS inidate , cast(:dataFin as date) AS inidate 
FROM 
  mytable a 
WHERE 
  a.date BETWEEN :dataIni AND :dataFin

Is there any way to return the parameter values as query fields using Firebird?

    
asked by anonymous 02.08.2014 / 19:03

2 answers

3

If I understand it right, just put the parameters as fields:

SELECT 
  a.*, 
  cast(:dataIni as date) AS inidate , 
  cast(:dataFin as date) AS inidate,
  :dataIni as DataInicial,
  :dataFin as DataFinal 
FROM 
  mytable a 
WHERE 
  a.date BETWEEN :dataIni AND :dataFin

I do not know if this is what you need!

    
21.09.2014 / 20:48
0

There's no way to do this.

A feature like this does not seem to be necessary either because the person who sent the query is also the one who will get the results and this subject knows the values that he passed as a parameter.

    
12.09.2014 / 00:17