Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request option for incremental loading without primary key #43

Closed
nixnut opened this issue Mar 11, 2016 · 2 comments
Closed

Request option for incremental loading without primary key #43

nixnut opened this issue Mar 11, 2016 · 2 comments

Comments

@nixnut
Copy link

nixnut commented Mar 11, 2016

I ran into a case where I want to do incremental reloading based on a timestamp only, i.e. give me all the records newer than the max timestamp of the previous load. Several records may have the exact same timestamp. Using the timestamp as primary key as well as modification field therefore doesn't work.

I propose a conditional WHERE clause based on the existence of the primary key in the arguments passed to the UpdateQvd routine

WHEN Len('$(_vPrimaryKey)')>0 SET _qvctemp.vWHERE = WHERE NOT exists($(_qvctemp.ExistsExpr));

REM If incremental reload, load previous data and concatenate to data just read.;
IF $(_vQvdExists) THEN
// Concatenate is required if adding fields
CONCATENATE ([$(_vTablename)])
LOAD * FROM $(_vQvdFile)
$(_qvctemp.vWHERE)

@RobWunderlich
Copy link
Owner

I think this case is already covered by setting?
SET Qvc.Loader.v.KeyFieldIsUnique=0;

@nixnut
Copy link
Author

nixnut commented Mar 13, 2016

PEBKAC. Messing up upper and lower case etc. Perhaps this change is acceptable so fools like myself can be a little careless:

LET _qvctemp.den.uniqueKey = ApplyMap('_qvctemp.TFMap', Upper(peek('UniqueKey', $(_qvctemp.den._listIndex), '$(_qvctemp.den.extractList)')), -1);

An additional record to the TFMap table might help too:
0, 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants