Skip to main content
Answer

How to use Parametrized SQL view in report designer?

  • November 24, 2024
  • 2 replies
  • 116 views

For complex report , I am creating CTE based sql view. In my view script there are multiple CTE. I want to filter every CTE with report input parameter so that less data get read by every CTE and  report performance gets improve.

To achieve this I would like to follow the same steps to create sql view with parameter. 

https://stackoverflow.com/questions/2281890/can-i-create-view-with-parameter-in-mysql

but I am confused as how to pass that parameter in DAC @p1 value so that the same parameter get reads by every cte.

 

Best answer by justen0351

Meghalad,

I am the one that posted the question that Darylbowan put a link to. The way I did it, was to add what i wanted to use as a “parameter” to every row. to do that, i added it to the sql  anchor, recursive, and select statement of the CTE. Then, when i pulled it into a GI, I used this Field as the parameter. Screenshots below.  Hope this helps you.

 

2 replies

darylbowman
Captain II
Forum|alt.badge.img+15

This seems similar to this question


Forum|alt.badge.img
  • Varsity III
  • Answer
  • December 6, 2024

Meghalad,

I am the one that posted the question that Darylbowan put a link to. The way I did it, was to add what i wanted to use as a “parameter” to every row. to do that, i added it to the sql  anchor, recursive, and select statement of the CTE. Then, when i pulled it into a GI, I used this Field as the parameter. Screenshots below.  Hope this helps you.