我现在不知所措,因为即使是最简单的声明,
BEGIN
DECLARE rs1 CURSOR WITH RETURN FOR
select * from table1;
END
WITH RETURN正在生成一个
SQL Error [42613]: [SQL0628] Clauses not valid in same definition.
文档https://www.ibm.com/docs/en/i/7.3?topic=codes-listing-sql-messages指出:
Clauses specified to define the attributes of a column, a sourced function, a procedure, a trigger, or an index are not valid. One of the following has occurred:
WITH RETURN is specified for a cursor in a compound (dynamic) statement.
如果不将此Select语句视为动态语句,该如何为游标调用它?
1条答案
按热度按时间n53p2ov01#
请参阅documentation
WITH RETURN指定要将游标的结果表用作过程结果集。如果过程的源代码中不包含DECLARE CURSOR语句,则忽略该子句。