我完全被 Snowflake 系统的权限模型弄糊涂了。我创建了一个数据库,在该数据库中创建了一个存储过程,并尝试使用 SYSADMIN 角色中的同一用户调用该存储过程。我收到错误“存储过程中的执行错误:SQL 编译错误:对象不存在或未授权。在 Statement.execute”
我什至不知道从哪里开始。我的用户怎么没有权限访问该用户创建的表?
最佳答案
检查您所引用的对象名称的大小写。例如,如果您创建了用双引号括起来的表,则它区分大小写。 Snowflake 自动将未加引号的标识符转换为大写。
例子:
CREATE TABLE test1 (
test nvarchar)
CREATE TABLE "teSt2" (
test nvarchar)
-- This works
select * from test1
-- This doesn't work because the table was created wrapped in double quotes and with a capital S in the name
select * from test2
-- This doesn't work either because it will convert to UPPER
select * from teSt2
-- This works
select * from "teSt2"
关于snowflake-cloud-data-platform - 雪花 : Execution error in store procedure : SQL compilation error: Object does not exist or not authorized. 在 Statement.execute,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61377923/