1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 22:14:35 +00:00

fix: refactored mp_getconstraints due to apparent bug in dictionary.table_constraints. Added test. Closes #83

This commit is contained in:
Allan Bowe
2021-10-01 13:04:26 +01:00
parent cb0ddfb61c
commit 35ddccaa16
4 changed files with 43 additions and 5 deletions

View File

@@ -49,8 +49,11 @@ create table &outds as
on upcase(a.TABLE_CATALOG)=upcase(b.TABLE_CATALOG)
and upcase(a.TABLE_NAME)=upcase(b.TABLE_NAME)
and a.constraint_name=b.constraint_name
where upcase(a.TABLE_CATALOG)="&lib"
and upcase(b.TABLE_CATALOG)="&lib"
/**
* 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
*/
where calculated libref="&lib"
%if "&ds" ne "" %then %do;
and upcase(a.TABLE_NAME)="&ds"
and upcase(b.TABLE_NAME)="&ds"