I have a Transaction Group, type Store Procedure Group.
My SQL procedure returns a boolean Error Status ( 0 = ok , 1 = error) and a text error message (some text describing the type of error if any)
Group works well, except that it always showed me "true" for the error status boolean.
Then I tried changing to Integer the type of the data I'm reading, and change also to Integer to the tag I'm writing to. And I am receiving a "48", which in Ascii code is a "0"
If I force bad data to receive an error back, I get a "49", which in Ascii code is "1"
I can do my "error checking" for a 49 with no issue,
but has someone seen this same thing?
is there a way around this?
Ideally, you would change the stored procedure to return the correct datatype.
Otherwise, make an expression item in the group, returning a boolean
Does it show a 0 or 1 when the groups item is set to String?
If so:
toBoolean({SP_Modules/SP_Module_3/Error_Status})
Otherwise, applying a bit of logic in the expression would work:
if({SP_Modules/SP_Module_3/Error_Status} = 49
true,
false
)
Thank you @JordanCClark
No, if set to string I still get 48 and 49.
Im connecting to a MariaDB with a MySQL translator, the field at the MariaDB is in fact a boolean.
Maybe there is an issue with the translation between DBs?
Weird thing is i can get a "1" or "0" if I query the DB from a NamedQuery, and I can use it as booleans without issue....
Anyhow, for my process, a Transaction Group works better, so using your proposed logic in the expression worked OK. allowing to be transparent outside of the Transaction Group to use a boolean for error flags.