The error message is simply (well, not so clearly ) saying that you try to assign null value into output field which can’t be set to null - at least that seems from the msg.
“dpavlis”
That’s what I thought too, but the target field is nullable.
The lookup(lkid,key par1,part2…) function takes the lookup table indicated by “lkid” and using key part1,part2,etc tries to look appropriate record and take value of “name” field from it.
It does not matter wheter part1 is hardcoded string or reference to variable or input field.
“dpavlis”
I am very glad to hear that!
- is the LookupTabple0 defined the way that it has only 1 field part of its key ?
“dpavlis”
Yes
- is the key a string type of filed (that is what your code suggests)
“dpavlis”
Initially it was an int. I have tried it with a string but with the same results. When you say ‘filed’, do you mean that it needs to be padded?
- do the records stored in the table have “name” field ?
“dpavlis”
Yes
- is , in the table really a record with key field containing ‘surname_id’ value ? (I guess not, it is rather name of the field, not content)
“dpavlis”
Yes. ‘surname_id’ is a valid field name in the input.
I have included my code and the expanded error message below. It is a very simple graph, I have to think that I am just missing something.
Thanks again!
Shane
Error Message:
DEBUG [WatchDog] - Node REFORMAT0 error details:
org.jetel.interpreter.TransformLangExecutorRuntimeException: Interpreter runtime exception on line 2 column 18 : when mapping “$name” (string) - assigning “null” (unknown type)
at org.jetel.interpreter.TransformLangExecutor.visit(TransformLangExecutor.java:1367)
at org.jetel.interpreter.ASTnode.CLVFMapping.jjtAccept(CLVFMapping.java:32)
at org.jetel.interpreter.TransformLangExecutor.executeFunction(TransformLangExecutor.java:1465)
at org.jetel.component.WrapperTL.executePreparedFunction(WrapperTL.java:326)
at org.jetel.component.RecordTransformTL.transform(RecordTransformTL.java:92)
at org.jetel.component.Reformat.execute(Reformat.java:196)
at org.jetel.graph.Node.run(Node.java:366)
at java.lang.Thread.run(Unknown Source)
#####################################################################################
## Code
#####################################################################################
<?xml version="1.0" encoding="UTF-8" standalone="no"?>