How to do this sql load from multiple tables from qvd-files?
I'm into reading from stored .qvd files instead of reading from DB-tables. I have qvd-files named as the DB-tables containing the whole table data.
What is best practice to perform such a load that is pasted below when reading from qvd-files instead?
It seems to me that I cannot add a variable name to the qvd's. Do I have to read in all the qvds involved, store them i residents and then use "where exists()" and finally drop the individual qvd-files?
brgds
Andy
LOAD ID as UTFID_test; SQL SELECT utf.ID FROM $(DB_SCHEMA).UTFALL utf, $(DB_SCHEMA).UTFALLKTOKOD kto, $(DB_SCHEMA).ARBORDER arb, $(AFFAR_tabell) ea WHERE utf.Year=$(Year) AND utf.Month=$(Month) AND kto.UTFID=utf.ID AND utf.AONR=arb.AONR AND ea.AFFAR_ID = arb.AFFAR_ID AND NOT (kto.KONTOKOD in ('A1','B1') AND (ea.KATEGORI like 'F%'));
Think that the INNER JOIN-function may help you (not tested):
LOAD * FROM UTFALL.qvd WHERE Year = $(iYear) ...; INNER JOIN LOAD ID FROM KTO.qvd; INNER JOIN LOAD AONR FROM ARB.qvd; ...
Am not sure, whether you may do a preceding load in order to reflect the last line above or whether this must be done in a second step (with resident load).