Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to reduce data in my dimension tables as such while performing a partial reload:
<loop...>
RIGHT KEEP ($(vTable)) LOAD DISTINCT * RESIDENT LINK_TABLE;
<... end loop>
It does not work, the statement is executed (visible in the logfile), but nothing happens and vTable keeps its original row numbers.
Any idea?
Thank you - Marcel
It seems to me that right keep does not work with partial load, as replace and add statements before load are not accepted.
Another method to reduce data could be - but much more complicated:
CALL CreateDimensionTablesString; // create a string containing all dimension tables
LET aa = 1;
LET vTable = SUBFIELD('$(sDIMENSION_TABLES)',';',$(aa));
DO WHILE 1
IF (LEN('$(vTable)') = 0) THEN
EXIT DO
END IF
IF (NOT MATCH('$(vTable)', '$(ignoreTables)')) THEN
CALL getUniqueKeyFieldForTables ( '$(vTable)', 'LINK_TABLE' ); // search the keyfield to the LINK_TABLE
t:
NOCONCATENATE ADD LOAD * RESIDENT $(vTable);
LEFT JOIN (t) ADD LOAD DISTINCT $(KEY_FIELD), 1 AS EXIST RESIDENT LINK_TABLE;
DROP TABLE $(vTable);
$(vTable):
NOCONCATENATE ADD LOAD * RESIDENT t WHERE EXIST = 1;
DROP TABLE t;
DROP FIELD EXIST;
END IF
LET aa = $(aa) + 1;
LET vTable = SUBFIELD('$(sDIMENSION_TABLES)',';',$(aa));
Instead of parsing a string with all dimenion tables, looping through NoOfTables will pose problems because of the drop table
statements, what affects internal table numbers.
Still, an easier method will be highly appreciated.
Marcel
LOOP