I am writing a BTEQ script to run multiple queries as a batch. In my BETQ script, my first query would be the count of records on the table and the second query will be Primary Key validation followed by some RI validation and so on. If the first query returns me a zero, meaning there are no records in the table; I do not want to execute rest of queries on that table. Please let me know how to write it in BTEQ script?
***** select count(*) from xyzDatabase.abcTable; if count(*) of xyzDatabase.abcTable > 0 Then execute all PK, RI queries related to xyzDatabase.abcTable else quit