You can translate the question and the replies:

Parameterized view join with other views

Hi Experts, I have requirement to join parameterized view with other views (not parameterized) . for that I have created parameterized view(buss_day_clndr) when I query this view alone with below sql it works fine. select count(clndr_dt) from buss_day_clndr where st_date = to_date('MM/dd/yyyy', '01/01/2017') and e_date=to_date('MM/dd/yyyy', '12/10/2017') and below also works fine if parameter values are hard coded and with other tables: select tb1.col1,tb2.col1,cc.count from table1 tb1 join table2 tb2 on tb1.tb_id=tb2.tb1_id left join buss_day_clndr cc on cc. st_date =to_date('MM/dd/yyyy', '01/01/2017') and cc. e_date = to_date('MM/dd/yyyy', '12/10/2017') When I replaced hard coded parameter values with dynamic column it is showing null, can you pls help ? select tb1.col1,tb2.col1,cc.count from table1 tb1 join table2 tb2 on tb1.tb_id=tb2.tb1_id left join buss_day_clndr cc on cc. st_date = tb1.created_dt and cc. e_date = tb1.updated_dt thanks!
user
29-01-2018 20:15:58 -0500
code

4 Answers

Hi, I tried to join parameterized view with other views and it worked fine for me in both the cases you have mentioned. "Null" values are returned in the join view when there is no matching record for the specified date value in the filtered condition . I would ensure the following conditions to get the expected result, * The Date field which is used in join condition should be of "Date" datatype in both the views. When the dynamically passed date field is of "text" data type then it will return null values. * The i18n configuration of both the views should be the same. Refer the section [Parameters of Derived Views](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/creating_derived_views/creating_selection_views/creating_selection_views#parameters-of-derived-views) of Virtual DataPort Administration Guide for more information on view parameters. Hope this helps.
Denodo Team
31-01-2018 07:07:04 -0500
code
Thank you for your answer! I verified all are date columns and tables are having same i8n configuration. can you pls provide more details how you able to achive ? below 2 sql's returning correct results: select count(clndr_dt) from buss_day_clndr where st_date = to_date(‘MM/dd/yyyy’, ‘01/01/2017’) and e_date=to_date(‘MM/dd/yyyy’, ‘12/10/2017’) select tb1.col1,tb2.col1,cc.count from table1 tb1 join table2 tb2 on tb1.tb_id=tb2.tb1_id left join buss_day_clndr cc on cc. st_date =to_date(‘MM/dd/yyyy’, ‘01/01/2017’) and cc. e_date = to_date(‘MM/dd/yyyy’, ‘12/10/2017’) Below returning null: select tb1.col1,tb2.col1,cc.count from table1 tb1 join table2 tb2 on tb1.tb_id=tb2.tb1_id left join buss_day_clndr cc on cc. st_date = tb1.created_dt and cc. e_date = tb1.updated_dt
user
 Edited on: 05-03-2019 14:54:19 -0500
can you pls provide more details with SQl's ?
user
 Edited on: 05-03-2019 14:54:19 -0500
Hi, In Virtual DataPort, when you specify left join condition then all the data from the left table and matching data from the right table are returned. The "NULL" values are returned when there is no matching data from the right table for the specified join condition. For your scenario, I would suggest you to ensure that you have matching data in both the join views. Hope this helps.
Denodo Team
09-02-2018 07:29:49 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here