Stored procedures with SUSPEND in them are so-called selectable procedures. You execute them with SELECT :
SELECT * FROM qt
or
SELECT * FROM qt()
The EXECUTE PROCEDURE intended only for procedures that produce the result of a single line. If you use it for a selectable stored procedure, then it will produce only one line (and exit when it gets to SUSPEND ).
In response to your request for what is documented:
- Interbase 6.0 Language Reference on page 177 says:
SUSPEND should not be used in an executable procedure.
- On page 178 is a table showing the behavior of
SUSPEND , EXIT and END in selectable and executable procedures (slightly modified to match):
Procedure type SUSPEND EXIT END Selectable β’ Suspends execution Jumps to final END β’ Returns control of procedure until to application next FETCH is issued β’ Sets SQLCODE to 100 β’ Returns output (end of record stream) values Executable β’ Jumps to final END Jumps to final END β’ Returns values β’ Not recommended β’ Returns control to application
- For a stored procedure (see page 178) that can create multiple lines, page 179 describes the differences in behavior when executed with
SELECT and executes with EXECUTE PROCEDURE .
source share