I am facing one interesting issue while reading from a calculation view through variables ... the code is as follows:
do begin
declare lv_ww nvarchar(6);
declare lv_quarter nvarchar(6);
select "WORKWEEK","QUARTER" INTO lv_ww,lv_quarter from "ABC"."TABLE1";
select count(*) from "_SYS_BIC"."CID" (PLACEHOLDER."IP_SNAPSHOTWW" => :lv_ww,PLACEHOLDER."IP_QUARTER" => :lv_quarter);
end;
I am getting column store error , search table error , plan operator failed in the select count(*) line. so basically out of memory issue because it is taking more than 15 gb memory.
Now when i will hard code the values for lv_ww = '202114' and lv_quarter = '2021Q2'
do begin
declare lv_ww nvarchar(6) default '202114';
declare lv_quarter nvarchar(6) default '2021Q2';
select count(*) from "_SYS_BIC"."CID" (PLACEHOLDER."IP_SNAPSHOTWW" => :lv_ww,PLACEHOLDER."IP_QUARTER" => :lv_quarter);
end;
It runs perfectly fine and takes only 0.012 gb.
Note - lv_ww and lv_quarter while calculating from TABLE1 are perfectly fine and giving us values as (lv_ww = 202114 and lv_quarter = 2021Q2)
Kindly let me know if you need any other details and please enlighten me for any solutions.