Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a column in a table in table for which am generating a surrogate value by using Numeric.sequence("S1",1000,1). This works fine for the 1st time but for the second time, I want it to take max value form the last generated surrogate value. Here I am taking the max of that column into a context variable and using in the tmap Numeric.sequence("S1",Max(Column_Name),1).
Here I am facing an issue. Context variable is not accepting the int value in it. I am getting error.
Can you please help me solve this issue.
Thanks in advance
ShaX
@ShaX ,can you just set a some value like 1 for that context,you will not get the warring.
@ShaX ,in th pre job you need to take the max key form the target table and load to context using tcontextload.you can use that context value this way in downstream.
Numeric.sequence("S1",context.DIm_DW_CUSTOMER_ID,1)
Hi,
it absolutely not clear from the description - what you really do?
in any variants, current form:
Numeric.sequence("S1",Max(Column_Name),1)is wrong
if you store max value (not seen - how) to context variable, it must be:
Numeric.sequence("S1",context.CONTEXT_VARIABLE_NAME,1)no MAX(), context. - mandatory
add:
as the default value for context variable use 1, it resolve null value warning
@ShaX ,yes As part of initialization,if you have not specified then it will take as Null and when the prejob completed successfully that max value would be stored in memory for that context and would be used in downstream.
change the initial context variable value to 1, type INT
in query use CASE for return 1 if it first iteration and max(column) for any other
store to context max(column) + 1
must work
Hi,
I got the weird result, here my max value is 1900, so it has to start from 1901 instead it is starting from 1190.
I got the below error in talend. and I have only 25353 rows instead of 35353 rows
@ShaX wrote:
Hi,
I got the weird result, here my max value is 1900, so it has to start from 1901 instead it is starting from 1190.
I got the below error in talend. and I have only 25353 rows instead of 35353 rows
it is not seen - what's wrong (it is work definitely)
diffrerence for 10 000 - because database rollback all batch (10k default batch size in talend) with any error
Hi @vapukov
Can you please explain how to over come this. caz i tried many ways but I am not understanding where am doing it wrong.
I think the issue is with the Variable which I am declaring as Int.
Am getting above error.
Regards
ShaX
Regards
ShaX