0

var P_ENV = 'int' var p_sqlText: CALL LS_**${P_ENV}**.HIID_SECURED.sp_getStatCertSaltValue(:1,:2); var stmt = snowflake.createStatement({sqlText:p_sqlText,binds: [P_ENV,P_STARTCERTID] });

    var rs = stmt.execute();
    rs.next();
    var p_saltvalue= rs.getColumnValue(1);

Unable to execute these lines in an stored procedure - calling the stored procedure with in the stored procedure - Thoughts please

1 Answer 1

1

Can you share the error message you get?

When I tried to test it, I was able to call the procedure:

create or replace procedure int_sp_getStatCertSaltValue( v1 varchar, v2 varchar)
returns object
language javascript
as
$$
  return { "v1": V1, "v2": V2 };
$$;

create or replace procedure spinsp()
returns object
language javascript
as
$$
 var P_ENV = 'int';
 var P_STARTCERTID = 1
 var p_sqlText = `CALL ${P_ENV}_sp_getStatCertSaltValue(:1,:2)`; 
 var stmt = snowflake.createStatement({sqlText:p_sqlText,binds: [P_ENV,P_STARTCERTID] });
 var res = stmt.execute();
 res.next();
 return res.getColumnValue(1);
$$
;

call spinsp();


+----------------------------+
|           SPINSP           |
+----------------------------+
| { "v1": "int", "v2": "1" } |
+----------------------------+
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.