Hi everyone,
I can't found how I can do this,
It seems to me, a python script can not do that because it can not return a null value...
Is there a workaround or something that makes it possible?
Thanks
Comments
2 comments
-
Hi @RomainH,
You can return DBNull like this to return NULLreturn DBNull
But I couldn't get a check for a row value of NULL to work. I triedval is None val is not None val is DBNull val is DBNull.Value val == DBNull val == DBNull.Value
But couldn't get it to work.
If I diddef main(config): if (col2 == "notnull "): return 4 else: return DBNull return 0<br>
Then it would correctly place null or the number 4
But that required me to know the value of col2 to check against.
So I'm not sure what might work here, perhaps you have solved that part of it and just returning DBNull will get you there, if so please let us know!
Kind regards,
Alex -
Alex B said:
But I couldn't get a check for a row value of NULL to work. I triedval is None val is not None val is DBNull val is DBNull.Value val == DBNull val == DBNull.Value
But couldn't get it to work.
Hello, I am struggeling with the same issue. Are there any updates on "how to check another column value for null within a python script"?
EDIT: Finally found out myself. We need to useval.IsNull
Found it by accident. Where is a documentation for that?
Add comment
Please sign in to leave a comment.