Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, i can't get something working in my script and was wondering if anyone can help..
I am reading multiple csv files into a table then concatenating an existing QVD to that table and storing back out (incremental load).
i am trying to get the script to check if the table exists before trying to concatenate the old data. if the table doesnt exist then i want to create an inline table for the old data to concatenate to.
I cant seem o get this right.
an example of what my script looks like..
For each File in filelist ('$(vRawDataDir)Sample_Tx_*.csv')
Data:
LOAD
Date,
....,
....,
.....
FROM [$(File)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Next
//Check if table exists, if not then create inline table
if NoOfRows(Data)=null() then
Data:
Load * inline [
Date
]
;
endif
// Load in old data
If QvdCreateTime('$(vDataDir)Data.qvd')>0 Then
CONCATENATE (Data)
LOAD DISTINCT *
FROM [$(vDataDir)Data.qvd] (qvd);
Endif
Can anyone help please?
Since your inline table is empty, why not just create it every time and forget about the conditional test?
-Rob
thats a good point, thanks Rob!