IsEmpty ( $SQL_RESULT )
will be true if your query had a null result returned.
You might also consider using ValueCount ( $SQL_RESULT )
since you need to know when to stop looping through values and this function will return a value of 0 when you get a null result.
But I'd specify the ¶ as my record separator here instead of "".
Hi PhilModJunk - Thanks! I tried both your ideas but will use ValueCount ( $SQL_RESULT ) so I can use it (as you suggest) to both evaluate whether the SQL returned records and also to gracefully exit the Loop.
Regarding your suggestion as to the record separator, "¶" is the default, and thus by using an empty string in that parameter it produced the same result as what you suggest, but I agree it probably makes the code clearer to explicitly specify the row separator as such. In any event, thanks again for your response; I really appreciate it.