The GOTO statement is used in conjunction with a label statement. The label
statement is the target of the GOTO statement. The GOTO statement directs
script processing to the line that contains the label statement to resume
processing from that point.
About this task
The label statement always has a colon (:) after it and may be blank
after the colon. The following example uses the GOTO statement to back up
the storage pool only if there are no sessions currently accessing the server.
In this example, the return code of RC_OK indicates that clients are accessing
the server. The GOTO statement directs processing to the
done: label which contains the EXIT statement that ends the script processing:
/* Back up storage pools if clients are not accessing the server */
select * from sessions
/* There are sessions if rc_ok is received */
if(rc_ok) goto done
backup stg backuppool copypool
done:exit