Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have two same identical tables different schema. I want to store in a single QVD while loading.
How to achieve this.
Script:
ODBC CONNECT TO SCHEMA1 (XUserId is ZXSCDERS, XPassword is QAZSXW);
EMP1:
Load ENAME,
JOB,
DEPTNO,
SAL,
COMM ,
'HR' as KEY;
SQL SELECT * FROM SCHEMA1.EMP;
ODBC CONNECT TO SCHEMA2 (XUserId is QWERDCS, XPassword is SXWSAS);
EMP2:
Load ENAME,
JOB,
DEPTNO,
SAL,
COMM ,
'SALES' as KEY;
SQL SELECT * FROM SCHEMA2.EMP;
store EMP1 into QVD\EMP.qvd;
store EMP2 into QVD\EMP.qvd;
Those table doesn't exists because qlikview concatenated automatically tables which have the same fields. I'm not sure if this also worked with those both preceeding loads - if your former load-script runs successfully and the table-viewer showed two EMP tables then not. If yes you will have only one table which you then could store as qvd. If not you need a noncatenate statement like this:
EMP:
Noconcatenate
load * Resident EMP1;
concatenate
load * Resident EMP2;
Store EMP into QVD\EMP.qvd;
- Marcus
ODBC CONNECT TO SCHEMA1 (XUserId is ZXSCDERS, XPassword is QAZSXW);
EMP1:
Load ENAME,
JOB,
DEPTNO,
SAL,
COMM ,
'HR' as KEY;
SQL SELECT * FROM SCHEMA1.EMP;
ODBC CONNECT TO SCHEMA2 (XUserId is QWERDCS, XPassword is SXWSAS);
EMP2:
Load ENAME,
JOB,
DEPTNO,
SAL,
COMM ,
'SALES' as KEY;
SQL SELECT * FROM SCHEMA2.EMP;
//store EMP1 into QVD\EMP.qvd;
//store EMP2 into QVD\EMP.qvd;
TRY:
EMP
load * Resident EMP1;
concatenate
load * Resident EMP2;
Store EMP into QVD\EMP.qvd;
Thank you Neetha_p.
Will check and let you know.
Hi,
I got this error:
ScriptErrorDetails | "EMP Table not found" |
Those table doesn't exists because qlikview concatenated automatically tables which have the same fields. I'm not sure if this also worked with those both preceeding loads - if your former load-script runs successfully and the table-viewer showed two EMP tables then not. If yes you will have only one table which you then could store as qvd. If not you need a noncatenate statement like this:
EMP:
Noconcatenate
load * Resident EMP1;
concatenate
load * Resident EMP2;
Store EMP into QVD\EMP.qvd;
- Marcus
Hi,
Yes use Noconcatenate,missed it.