The Ingres tm
terminal monitor—better known as sql
—has a macro facility that provides, among other things, conditional execution.
The following example checks to see if the myproc
procedure exists and if it does (tuplecount—that is, row count—is greater than 0), it skips everything between the \branch
and the next-step
SELECT distinct procedure_name
WHERE procedure_name = 'myproc'
AND procedure_owner = dbmsinfo('username');