fix: using temporary names for temporary tables
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m6s

Closes #124
This commit is contained in:
allan 2024-08-31 16:19:04 +02:00
parent caa9854ff0
commit ce503653cd

View File

@ -100,6 +100,7 @@ Areas for optimisation
@li mf_getattrn.sas
@li mf_getengine.sas
@li mf_getschema.sas
@li mf_getuniquefileref.sas
@li mf_getuniquename.sas
@li mf_getuser.sas
@li mf_getvarlist.sas
@ -621,7 +622,7 @@ data work.bitemp0_append &keepvars &outds_del(drop=&md5_col )
%put DCNOTE: Extracting matching observations from &base_lib..&base_dsn;
%if &engine_type=OLEDB %then %do;
%let temp_table=##BITEMP_&base_dsn;
%let temp_table=##%mf_getuniquefileref(prefix=BTMP)_&base_dsn;
%if &loadtype=BITEMPORAL or &loadtype=TXTEMPORAL %then
%let base_table=(select * from [dbo].&base_dsn
where convert(datetime,&SQLNOW) < &tech_to );
@ -1049,7 +1050,7 @@ run;
%let cat_string=catx('|' ,&bus_from,&bus_to);
data work.bitemp5a_lkp (keep=&md5_col)
%if "%substr(&sysver,1,1)" ne "4" and "%substr(&sysver,1,1)" ne "5" %then %do;
%if "%substr(&sysver,1,1)" ne "4" & "%substr(&sysver,1,1)" ne "5" %then %do;
/nonote2err
%end;
;
@ -1191,10 +1192,10 @@ run;
/* if OLEDB then create a temp table for efficiency */
%local innertable;
%if &engine_type=OLEDB %then %do;
%let innertable=[##BITEMP_&base_dsn];
%let innertable=[&temp_table];
%let top_table=[dbo].&base_dsn;
%let flexinow=&SQLNOW;
create table &base_lib.."##BITEMP_&base_dsn"n as
create table &base_lib.."&temp_table"n as
select * from work.bitemp5d_subquery;
/* open up a connection for pass through SQL */
%dc_assignlib(WRITE,&base_lib,passthru=myAlias)