21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Script Example:<br />

QV_Table:<br />

SQL SELECT PrimaryKey, X, Y FROM DB_TABLE<br />

WHERE ModificationTime >= #$(LastExecTime)#;<br />

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD<br />

WHERE NOT Exists(PrimaryKey);<br />

STORE QV_Table INTO File.QVD;<br />

Case 4: Insert, Update and Delete<br />

The most difficult case to handle is when records are actually deleted from the source database between<br />

script executions. The following conditions apply:<br />

398<br />

l The data source can be any database.<br />

l <strong>QlikView</strong> loads records inserted into the database or updated in the database after the last script execution.<br />

l <strong>QlikView</strong> removes records deleted from the database after the last script execution.<br />

l A field ModificationDate (or similar) is required for <strong>QlikView</strong> to recognize which records are new.<br />

l A primary key field is required for <strong>QlikView</strong> to sort out updated records from the QVD file.<br />

l This solution will force the reading of the QVD file to "standard mode" (rather than "super-fast mode"), which is still<br />

considerably faster than loading the entire database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!