The SP gets compiled but when executing doesn't display values. I wanted to show paid date and service date along with their column name.
CREATE OR REPLACE
PROCEDURE DATETYPE ()
RESULT SETS 1
LANGUAGE SQL
SPECIFIC DATE
BEGIN
DECLARE C1 CURSOR FOR SELECT
1 AS Value,
'Paid Dates Only' AS LABEL
FROM sysibm.sysdummy1
UNION ALL SELECT
2 AS Value,
'Service Date' AS LABEL
FROM sysibm.sysdummy1;
OPEN C1;
END;
You have to tell which cursor you want as result set, even if there is only one
DECLARE C1 CURSOR WITH RETURN FOR SELECT...