Reputation: 23
I want to call the procedure created in main account from a reader account
I have couple of tables shared between them:
Procedure
table contains procedure names (to be called in main account) and id.
Calling the procedure as below but unable to do so
set var1 = (select procedure_name from procedure_calls);
call $var1;
Please let me know is it possible to call the way I am calling ?
Upvotes: 1
Views: 4169
Reputation: 11086
I want to call the procedure created in main account from a reader account
Currently, you can't do this from a reader account. A reader account can run select queries on the tables and secure views its parent account shares to it, and that's all it can do. It can't run other statement types including CALL.
Upvotes: 2
Reputation: 11
Example - I have a stored procedure
copy_into_temp_table(table_name VARCHAR)
It can be called via the below statement
CALL copy_into_temp_table(EMP_TBL);
Upvotes: 0
Reputation: 59325
You need to wrap the string with the stored procedure name in a literal identifier()
:
set sp = 'Load_Employee';
call identifier($sp)()
https://docs.snowflake.com/en/sql-reference/identifier-literal.html
Upvotes: 1