我想在 DB2 中编写一个存储过程,它将有一个表的游标,然后它将整个游标行发送到 C 程序?
谁能帮我?
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;