SQL工作笔记 达梦7存储过程中游标的使用(for循环 IF等)
表如下: 如下存储过程使用游标遍历所有数据: CREATE OR REPLACE PROCEDURE "CFFTEST"."SELECT_STUDENT"("id" IN INT) AS myId int; myName varchar(50); cursor myCursor is select id, name from cfftest.student; BEGIN open myCursor; loop fetch myCursor into myId, myName; exit when myCursor%notfound; print 'id: ' ||
用户评论