Monday, September 15, 2008

SQL - SQLExec returns null instead of a blank field

Sam found that the SQLExec function has some unexpected behaviour when used to retrieve a blank field. If the field it returns contains a blank space in the database PeopleSoft trims it and returns it as an empty string.

This means you can’t tell whether the query returned a row but the field was blank or the query didn’t return any rows at all.

You have to either check for the existence of a required field or use the %SQLRows variable to work it out.

No comments: