diff --git a/all.sas b/all.sas index 05f71b0..f8df375 100644 --- a/all.sas +++ b/all.sas @@ -6665,8 +6665,11 @@ create table &outds as /** * We cannot apply this clause to the underlying dictionary table. See: * https://communities.sas.com/t5/SAS-Programming/Unexpected-Where-Clause-behaviour-in-dictionary-TABLE/m-p/771554#M244867 + * cannot use`where calculated libref="&lib"` either as it will STILL execute + * all the underlying constraint queries, causing exception errors in some + * cases: https://github.com/sasjs/core/issues/283 */ - where calculated libref="&lib" + where a.TABLE_CATALOG="&lib" %if "&ds" ne "" %then %do; and upcase(a.TABLE_NAME)="&ds" and upcase(b.TABLE_NAME)="&ds" diff --git a/base/mp_getconstraints.sas b/base/mp_getconstraints.sas index 95eac49..1ba65a9 100644 --- a/base/mp_getconstraints.sas +++ b/base/mp_getconstraints.sas @@ -94,8 +94,11 @@ create table &outds as /** * We cannot apply this clause to the underlying dictionary table. See: * https://communities.sas.com/t5/SAS-Programming/Unexpected-Where-Clause-behaviour-in-dictionary-TABLE/m-p/771554#M244867 + * cannot use`where calculated libref="&lib"` either as it will STILL execute + * all the underlying constraint queries, causing exception errors in some + * cases: https://github.com/sasjs/core/issues/283 */ - where calculated libref="&lib" + where a.TABLE_CATALOG="&lib" %if "&ds" ne "" %then %do; and upcase(a.TABLE_NAME)="&ds" and upcase(b.TABLE_NAME)="&ds"