Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I need your help with the following issue: I have to use an excel field in a sql where sentence.
That's what I'm doing:
DIM_TARGET_COM_AUX:
LOAD @1 as ID_EXT_AUX,
@3 as PACK_ID_AUX,
@5 as CUSTCODE_AUX,
@7 as MSISDN_FECHA_AUX
FROM
[C:\Users\S231660\Desktop\TARGET\asignacion_auto_promo_*.dat]
(txt, utf8, no labels, delimiter is ';', msq);
[SUM_COM]: LOAD concat(CHR(39) & CUSTCODE_AUX & CHR(39) ,',') AS CUSTCODE_LIST Resident DIM_TARGET_COM_AUX;
LET v_custcode = CUSTCODE_LIST;
CUSTOMER_ALL:
LOAD
CUSTOMER_ID;
SQL SELECT CUSTOMER_ID
FROM CUSTOMER_ALL
WHERE CUSTCODE in ( $(v_custcode) );
The problem is that at execution time I got an error saying that v_custode is empty, but in the SUM_COM table the field CUSTCODE_LIST is populated.
Can you help me on this? do you know a better way to do it?
Thanks a lot for your help.
You are not declaring v_custcode correctly.
Try this:
LET v_custcode = peek('CUSTCODE_LIST', -1, 'SUM_COM');
You are not declaring v_custcode correctly.
Try this:
LET v_custcode = peek('CUSTCODE_LIST', -1, 'SUM_COM');