How can i insert current_date() bind variable into a table using snowflake stored procedure
CREATE OR REPLACE PROCEDURE abc ( "P_MESSAGE_ID" FLOAT, "P_THEATER" STRING, "P_MONTH" STRING, "P_MESSAGE" STRING, "P_START_DATE" STRING, "P_END_DATE" STRING, "P_ACTION" STRING, "P_MSG_TYPE" STRING, "P_LOGGED_USER" STRING ) RETURNS variant LANGUAGE JAVASCRIPT AS $$
var query="INSERT INTO abc(MESSAGE_ID,MESSAGE,THEATER,CREATED_BY,CREATE_DATE,UPDATED_BY, UPDATE_DATE,MONTH,START_DATE,END_DATE,MESSAGE_TYPE)
VALUES(E2E_BANNER_MSG_S.NEXTVAL,
:2,
:3,
:4,
:5,
:6,
:7,
:8,
:9,
:10,
:11);"
var sql = snowflake.createStatement
({
sqltext: query,
binds :[P_MESSAGE_ID,
P_MESSAGE,
P_THEATER,
P_LOGGED_USER,
current_date(),
P_LOGGED_USER,
current_date(),
P_MONTH,
P_START_DATE,
P_END_DATE,
P_MSG_TYPE]});
var result = sql.execute(); $$;
Iam getting the below error :
execution error: Uncaught ReferenceError: CURRENT_DATE is not defined in ABC at ' P_LOGGED_USER,' position 40
Can you help me to resolve this issue
Thanks, nikhil