Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When I run the following code the peek command seems to stop working after the SQL select command.
For the second row vTable,vField & vDescr are set to Null when for k = 0 to $(y) is on it's second pass.
Any ideas why this is happening?
Mark
tmp:
load * inline [
TABLE, FIELD,DESCR
'ITMMASTER','ITMREF_0','Product'
'BPCUSTOMER','BPCNUM_0','Customer'
];
Counts:
LOAD Count(FIELD ) as Y
Resident tmp;
LET y = Peek('Y', 0) - 1;
DROP Table Counts;
for k = 0 to $(y)
LET vTable = PEEK('TABLE', $(k));
LET vTable = 'IDIS.' & vTable ;
LET vField = PEEK('FIELD', $(k));
LET vDescr = PEEK('DESCR', $(k));
LOOKUPS:
SQL SELECT $(vField) AS LOOKUP_FIELD, '$(vTable)' AS LOOKUP_TABLE from $(vTable);
NEXT k
I needed to explicitly set the table in peek, this has made it work.
LET vField = PEEK('FIELD', $(k),'TMP');
I needed to explicitly set the table in peek, this has made it work.
LET vField = PEEK('FIELD', $(k),'TMP');
Had the exact same issue, thanks for adding your solution.