Hi,
the problem we had when comparing a blank string is that if you look at the string and the data type is varchar 12, you get the value left oriented and filled out with blank to the left.
(
We run DB2 for iSeries through federation server)
if you run a string.len on a "blank" string you get 12 in this case (12 blank characters)
I solved the problem by creating this funktion and using regex to validate the string:
(Checking if the string starts with one or more blanks)
function isBlank(x) return tostring(x):find("^%s+$")endand use it like:
if (isBlank(srcvalue))then target.column.setvalue(source.column.getvalue())else target.column.setvalue(newvalue)end
Best regards,
Per
------------------------------
Per Wallqvist
------------------------------
Original Message:
Sent: 02-04-2019 02:38 AM
From: FRIEDRICH PFNEISL
Subject: LUA and empty strings
Hi,
Does anyone have experience with LUA and empty strings?
How to check if a string is empty?
"string.len" returns 25 for an empty varchar(25) column...
Thanks,
Fritz
------------------------------
FRIEDRICH PFNEISL
Optim SME
Austria
------------------------------
#InfoSphereOptim
#Optim