What is wrong with the following code?
PROCEDURE DATETYPE DYNAMIC RESULT SETS 1 LANGUAGE SQL
BEGIN
DECLARE @DateType TABLE
( LABEL CHAR(30) ,
Value VARCHAR(1) );
DECLARE C CURSOR WITH RETURN FOR;
INSERT
INTO
@DateType
VALUES ('Paid Dates Only',
'P') INSERT
INTO
@DateType
VALUES('Incurred Dates with Paid',
'S') SELECT
*
FROM
@DateType;
OPEN C;
END
I am using db2 and gets the following error:
SQL Error [42601]: An unexpected token "( LABEL CHAR(30) , Value VARCHAR(1) )" was found following " ". Expected tokens may include: "E @DateType TABLE ".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.21.29