我想在DB2中编写一个存储过程,它将有一个表的游标,然后它会将整个游标行发送到C程序?
任何人都可以帮助我吗?
答案 0 :(得分:0)
CREATE PROCEDURE GETNAMESET ( IN CNUM INTEGER )
RESULT SET 1
LANGUAGE SQL
BEGIN
--Take the inputted customer number, CNUM and
--return the record(s) for that customer from the
--customer table via SQL result set(s)
DECLARE C1 CURSOR FOR
SELECT * FROM CUSTTABLE WHERE CUSTNUM = CNUM;
OPEN C1;
SET RESULT SETS CURSOR C1;
END;