V5R4: 集成RPGIV自由格式和SQL
在OS/400 V5R4版本下,首次集成了RPGIV自由格式和SQL。
IBM讲稿例子:
Integration of free-format RPG and SQL
d getOrderCount pi 10i 0
d inCustNumber 9b 0 const
d outSqlState 5a
d outSqlMsg 256a
d ordercount s 10i 0
/free
outSqlMsg = *blanks;
exec sql SELECT count(*) into :orderCount FROM orders
WHERE cust_no = :inCustNumber;
outSqlState = sqlState;
if %subst(sqlState:1:2) <> '00';
exec sql GET DIAGNOSTICS CONDITION 1
:outSqlMsg = MESSAGE_TEXT;
orderCount = 0;
endif;
return orderCount;
/end-free
阅读(832) | 评论(0) | 转发(0) |