CREATE OR REPLACE TABLE table1
(
column1 INT
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "transact", "convertedOn": "11/13/2024", "domain": "test" }}'
;
CREATE OR REPLACE PROCEDURE procedure1 ()
RETURNS TABLE()
LANGUAGE SQL
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": { "major": 0, "minor": 0, "patch": "0" }, "attributes": { "component": "transact", "convertedOn": "11/13/2024", "domain": "test" }}'
EXECUTE AS CALLER
AS
$$
DECLARE
ADDCOUNT INT := 0;
ProcedureResultSet RESULTSET;
BEGIN
INSERT INTO table1 (column1) VALUES (1),(2),(3);
ADDCOUNT := :ADDCOUNT + SQLROWCOUNT;
ProcedureResultSet := (
select
:ADDCOUNT);
RETURN TABLE(ProcedureResultSet);
END;
$$;
CALL procedure1();