exists command checks whether at least one record matches a query and exits with code 0 (found) or 1 (not found). Use it in shell scripts to gate on record existence.Check if a record exists (exit code 0/1).
exists command checks whether at least one record matches a query and exits with code 0 (found) or 1 (not found). Use it in shell scripts to gate on record existence.sn exists <table> <query> Check if a record exists. Exits 0 if found, 1 if not.
| Name | Required | Description |
|---|---|---|
| table | Yes | The table to query. |
| query | Yes | Encoded query string. |
sn exists sys_script_include "name=MyHelper" && echo "found"