Was this helpful?
Embedded SQL Language Considerations
In the example above, use a callproc statement rather than a callframe statement. However, there are special considerations in embedded query language.
You must not return immediately from inside a display loop, a select loop, or from a routine that has cursors open. To exit each of these cleanly, use the appropriate embedded SQL statements before returning to the calling frame, as follows:
Break out of a display loop with the breakdisplay or enddisplay statement.
Exit from a select loop with the endselect statement.
Close open cursors with the close statement.
For example, the following section shows a program fragment that illustrates returning a status of 11 from inside a display loop.
Example
exec frs activate menuitem 'Top';
exec frs begin;
    status = 11;
exec frs breakdisplay;   
    /* drop out of display loop */
    /* don't want to do   */
    /* 'return (11);' here because */
    /* we're inside a display loop */
exec frs end;
exec frs finalize;
    return ( status );
Last modified date: 11/28/2023