Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Combination of two fields as primary key in Qvc Incremental load

Hi Gurus,

How to define Combination of two fields as Primary Key In QVC Incremental Load

CALL Qvc.IncrementalSetup ('Orders', 'LastUpdate', 'Field1 & Field 2 ');



here field1 and Field2 combination is my Primary Key


any Help would be greatly appreciated.

Thanks,

Rajiv

rwunderlich

5 Replies
marcus_sommer

Without knowing any details how this qvc-routine is implemented it should be look more in this way:

CALL Qvc.IncrementalSetup ('Orders', 'LastUpdate', 'Field1' & '|' & 'Field2');

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

Thanks for your time.

Iam using QVC Script for My Oracle EBS incremental load.i have one table  and here the Primary key is Combination of two fields. if i give CALL Qvc.IncrementalSetup ('Orders', 'LastUpdate', 'Field1' & '|' & 'Field2');

as you suggested its not taking.

Thanks,

Rajiv

marcus_sommer

It could be that's not possible in this way and you might need to create these key in beforehand. Maybe rwunderlich could help in this case.

- Marcus

Anonymous
Not applicable
Author

Here is the Script

$(Include=<\\......\qvc_runtime\qvc.qvs>);

// The directory for the QVD file

SET Qvc.Loader.v.QvdDirectory='\\...\Qview\DEV\Incremental logic\QVD\';

// How far back to load if First Load

LET Qvc.Loader.v.BaseValue = num(MakeDate(2015,01,01));

// Datetime literal format for Excel - Shipper exercise

set Qvc.Loader.v.DatabaseDatetimeMask ='MM/DD/YYYY';

// Will the max Modfield value be stored with the QVD?

// The recommended value is True. This will greatly speed up subsequent loads.

SET Qvc.Loader.v.StoreMaxModFieldValue = -1;

CALL Qvc.Log('>>>  Incremental Load with inserts & updates');

//set KeyField=(T_ID&'-'&I_ID);

// Calling parameters are Tablename, UpdateColumn, QVD_PrimaryKey.

CALL Qvc.IncrementalSetup ('Table','LAST_UPDATE_DATE', 'KeyField'); 

//*** If SQL, the CONNECT statement would go here ***

// Add SQL/LOAD statement here

[$(Qvc.Loader.v.Tablename)]:

load

*,

T_ID&'-'&I_ID as KeyField;

Directory;

  // vTablename is set by the IncrementalSetup routine.

// Load script goes here. Be sure to include the WHERE condition below. 

SELECT

*

FROM

Table  WHERE  $(Qvc.Loader.v.IncrementalExpression);

  // IncrementalExpression is set up the Qvc.IncrementalSetup routine.

// Log the ending stats

Call Qvc.Log ('$(Qvc.Loader.v.Tablename) loaded, rows=' & num(NoOfRows('$(Qvc.Loader.v.Tablename)'), '#,##0'));

// Update the QVD with the changed rows

CALL Qvc.IncrementalStore

CALL Qvc.Cleanup;

CALL Qvc.RemoveEnvironmentVariables;

LET LOAD_DURATION=now(1) - SCRIPT_START;

Thanks,

Rajiv

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Question is being addressed on the QVC User Forum:

Google Groups

-Rob