I have reviewed your query, and I understand why you added ‘select null as something’ as a check to handle empty results. However, I wanted to provide you with a bit more context. Let me explain a working example script with you.
It sets up a database connection (MySQL in this case).
Runs the query SELECT * FROM ‘test’.
Iterates through the results (arc:enum item=”db”) and outputs each row/column.
If no data is returned, the arc:else branch is triggered and throws a custom error (null Value). You can modify the error description in this line according to your needs: <arc:throw code=“myerror” desc=“null Value” />
So, in effect, you don’t need to rely on comparing the raw <table></table> output — this script gracefully handles the case where no records are returned by explicitly checking and throwing an error if the result is null/empty.
If scripting is the only option in your current use case, this solution works fine. But for cleaner handling and long-term maintainability, we recommend using a dedicated database connector (like the MySQL connector). Connectors usually provide built-in ways to handle empty result sets or errors, so you won’t need to manually check for <table></table> or add workarounds.
I hope this helps you achieve your use case. Please feel free to reach out to us at arcsupport@cdata.com if you have any further questions.
This website stores cookies on your computer. These cookies are used to collect information about how you interact with our website and allow us to remember you. We use this information in order to improve and customize your browsing experience and for analytics and metrics about our visitors both on this website and other media.
Review section III of our Privacy Policy for more information on cookies.
To opt out of “sale” or “sharing” of non-cookie data, visit our Privacy Rights Request Form.