Stored Procedure fails with error “Requested information on the current user is not accessible in stored procedure”

When running a Stored Procedure that triggers a query to run against Views or Functions from INFORMATION_SCHEMA, it might fail with below error message: Requested information on the current user is not accessible in stored procedure. This can be easily reproduced using below code: The reason for the failure is because for the owner’s right […]

Continue Reading

File Pruning for External Tables

Currently Snowflake does not support pruning External Table files. To prove it, I have performed below test. Assume that I have an external S3 stage setup correctly, which points to an external S3 location with a few CSV files, I create below external table: The stage @ERICLIN_S3_STAGE/test contains a list of CSV files And each […]

Continue Reading

Stored Procedure with Date parameter failed with error: “Unsupported type for binding argument 2”

It is common that we will need to perform Date transformations inside Stored Procedures in SQL. Recently I have encountered an error that Snowflake does not like the format that is generated by Javascript inside Stored Procedure code, and resulted an error. See below example: To execute this Stored Procedure, simply run below query: And […]

Continue Reading