0
votes

I have tried to execute below query it is throwing error like "Uncaught ReferenceError: float_param1"

create or replace table test1(num_col1 number);

create or replace procedure rt(float_param1 float )
returns string 
language javascript 
as
$$
var sql_command=
 "insert into test1 (num_col1) values ("+ float_param1 +")";

snowflake.execute(
    {sqltext:sql_command}
    );
return 'succes.';
$$ 
;
call rt(12.23::float);

error is like "JavaScript execution error: Uncaught ReferenceError: float_param1 is not defined in RT at ' "insert into test1 (num_col1) values ("+ float_param1 +")";' position 42 stackstrace: RT line: 3"

1

1 Answers

0
votes

Input parameter should be upper case inside the stored procedure.

var sql_command= "insert into test1 (num_col1) values ("+ FLOAT_PARAM1 +")";