snowflake db stored procedure

May 5 2021 11:52 AM
Hi,
 
CREATE OR REPLACE PROCEDURE simple_stored_procedure_example()
RETURNS VARIANT
language javascript
as
$$
var cmd = "select count(*) from TEMP.PUBLIC.TEMP_FCT_DAY_DRVR_TIMESHEET"
var sql = snowflake.createStatement({sqlText: cmd});
var result = sql.execute();
return result;
$$;
 
call  simple_stored_procedure_example();
 
here, i want to return the row count but i am getting result as [object object]. i need integer value.
please help. 

Answers (2)