Error: assert(areTypesComparable(leftType,rightType)) failed
I get the following run time error: Error: assert(areTypesComparable(leftType,rightType)) failed - file: hqlcpp.cpp, line 4955 (605, 17)
It is directing me to the following code:
I can remove either the block of sums or the if(sums) and it seems to work. It just doesn't like having both in the same table. I can work around this in my code, but I don't understand why it's a problem and the error message is not helping (other than the line number).
It is directing me to the following code:
- Code: Select all
r_shop5 := record
d_shop4.id;
d_shop4.shopper_dob;
d_shop4.shop_date;
d_shop4.shopped_carrier;
d_shop4.shop_state;
d_shop4.shop_zip;
unsigned sum_val1 := sum(group,d_shop4.shop_val1);
unsigned sum_val2 := sum(group,d_shop4.shop_val2);
unsigned sum_val3 := sum(group,d_shop4.shop_val3);
unsigned sum_val4 := sum(group,d_shop4.shop_val4);
STRING1 val1_in := if(sum(group,d_shop4.shop_val1)>0,'Y','N');
STRING1 val2_in := if(sum(group,d_shop4.shop_val2)>0,'Y','N');
STRING1 val3_in := if(sum(group,d_shop4.shop_val3)>0,'Y','N');
STRING1 val4_in := if(sum(group,d_shop4.shop_val4)>0,'Y','N');
end;
d_shop5 := table(d_shop4,r_shop5,id,shopper_dob,shop_date,shopped_carrier,shop_state,shop_zip,local);
I can remove either the block of sums or the if(sums) and it seems to work. It just doesn't like having both in the same table. I can work around this in my code, but I don't understand why it's a problem and the error message is not helping (other than the line number).
- janet.anderson
- Posts: 52
- Joined: Wed Jul 17, 2013 5:31 pm
Janet,
Can you try this and see if it compiles/works?
HTH,
Richard
Can you try this and see if it compiles/works?
- Code: Select all
r_shop5 := record
d_shop4.id;
d_shop4.shopper_dob;
d_shop4.shop_date;
d_shop4.shopped_carrier;
d_shop4.shop_state;
d_shop4.shop_zip;
unsigned sum_val1 := sum(group,d_shop4.shop_val1);
unsigned sum_val2 := sum(group,d_shop4.shop_val2);
unsigned sum_val3 := sum(group,d_shop4.shop_val3);
unsigned sum_val4 := sum(group,d_shop4.shop_val4);
STRING1 val1_in := if(self.sum_val1>0,'Y','N');
STRING1 val2_in := if(self.sum_val2>0,'Y','N');
STRING1 val3_in := if(self.sum_val3>0,'Y','N');
STRING1 val4_in := if(self.sum_val4>0,'Y','N');
end;
d_shop5 := table(d_shop4,r_shop5,id,shopper_dob,shop_date,shopped_carrier,shop_state,shop_zip,local);
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
if(self.sum_val1>0,'Y','N') did not work (Error: SELF cannot be used to provide a value for field 'adpf_in' (605, 36), 2316, ), but if(max(group,d_shop4.shop_val1)>0,'Y','N') does.
There is no urgency around this since there is a workaround, I just can't seem to wrap my head around why there is an issue with the original code or your proposed code.
FYI - this was a runtime error, not a compiler error.
There is no urgency around this since there is a workaround, I just can't seem to wrap my head around why there is an issue with the original code or your proposed code.
FYI - this was a runtime error, not a compiler error.
- janet.anderson
- Posts: 52
- Joined: Wed Jul 17, 2013 5:31 pm
Janet,
Glad you found a workaround, but you should definitely create a JIRA ticket for this issue.
HTH,
Richard
Glad you found a workaround, but you should definitely create a JIRA ticket for this issue.
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest