Skip to content

Commit

Permalink
Merge pull request #353 from rudvfaden/main
Browse files Browse the repository at this point in the history
added authdomain for odbc engine in MM_ASSIGNDIRECTLIB
  • Loading branch information
allanbowe authored Oct 17, 2023
2 parents 592f477 + 3a5fd4b commit fcafb10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ mc_*
*.env*

~
.gitattributes
11 changes: 9 additions & 2 deletions all.sas
Original file line number Diff line number Diff line change
Expand Up @@ -14552,7 +14552,7 @@ run;
%else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details;
data _null_;
length connx_uri conprop_uri value datasource up_uri schema $256.;
length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.;
call missing (of _all_);
/* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
Expand All @@ -14567,6 +14567,13 @@ run;
rc2=-1;
end;
end;

/* get auth domain */
autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri);
arc=metadata_getattr(domprop_uri,"Name",authdomain);
if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain);
call symputx('authdomain',authdomain,'l');

/* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema);
Expand All @@ -14583,7 +14590,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end;
%else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end;
%end;
%else %if &engine=POSTGRES %then %do;
Expand Down
11 changes: 9 additions & 2 deletions meta/mm_assigndirectlib.sas
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ run;
%else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details;
data _null_;
length connx_uri conprop_uri value datasource up_uri schema $256.;
length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.;
call missing (of _all_);
/* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
Expand All @@ -227,6 +227,13 @@ run;
rc2=-1;
end;
end;

/* get auth domain */
autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri);
arc=metadata_getattr(domprop_uri,"Name",authdomain);
if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain);
call symputx('authdomain',authdomain,'l');

/* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema);
Expand All @@ -243,7 +250,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end;
%else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end;
%end;
%else %if &engine=POSTGRES %then %do;
Expand Down

0 comments on commit fcafb10

Please sign in to comment.