I am trying to use the Snowflake connector in Tableau to query an external Snowflake table.
I cannot see the external table in the list of all tables on the left pane in Tableau (only regular Snowflake tables), so I have tried to pull from the external table using SQL.
Running this from the Snowflake site gets me the contents of the external table:
select * from EXTERNAL_TABLE_NAME;
Running the same from the "New Custom SQL" dialog in Tableau's Snowflake connector gets me this:
SQL compilation error: Object 'EXTERNAL_TABLE_NAME' does not exist or not authorized.
I also tried the following:
select from #DATABASE_NAME.SCHEMA_NAME.STAGE_NAME.EXTERNAL_TABLE_NAME
...which gets me: SQL compilation error: Object does not exist, or operation cannot be performed.
Any thoughts on what I can do to get this to work? I don't think it is a permissioning issue because I am using the same account to auth in Tableau as I am on the Snowflake website.
I'm guessing that I simply need to do a better job pointing to the location where the external table is, but I can't figure it out.
Thanks in advance for your help!
Looks like this is a deeper permissioning issue that I will have to resolve with our Snowflake admin. I was able to pull to Tableau from an external Snowflake table successfully using a different ROLE and DATABASE, so marking this resolved.
Related
I am managing to connect to data in my organisation via Denodo Design Studio fine, but when I try to do it through DBeaver, I get the following error: SQL Error [20100] [HY000]: The user does not have EXECUTE privileges on the view XXXX
Any idea where I should look to fix this? I am just doing a simple SELCT * FROM XXXX table query for a small table.
I also have no issues connecting to the database, and can navigate the schemas and see the table/view names.
Using Denodo denodo-vdp-jdbcdriver-8.0-update-20220815 via the DBeaver Denodo connector.
I am getting error while creating a table in snowsql client which says
003540 (42501): SQL execution error: Creating table on shared database 'SNOWFLAKE_SAMPLE_DATA' is not allowed.
can anyone help me out how to resolve this error?
Snowflake sessions have "context", such as current role, warehouse, database, and schema.
It appears your current session "context" has your database set to one of sample databases,
which was created from a "Share".
Databases created from a share are readonly, so you cannot create a table in them.
The good news is the fix is easy, you can either:
use a fully qualified table name (databaseName.schemaName.tableName) to create your table in a database/schema that you have proper access to.
USE DATABASE snowflake_sample_data;
USE SCHEMA tpch_sf1;
CREATE TABLE myDatabase.mySchema.myNewTableName AS SELECT * FROM lineitem;
change your session context to a database/schema you have access to create tables, and use the fully qualified table name of the tables you are reading from.
USE DATABASE myDatabase;
USE SCHEMA mySchema;
CREATE TABLE myNewTableName AS SELECT * FROM snowflake_sample_data.tpch_sf1.lineitem;
Relevant docs links:
https://docs.snowflake.com/en/sql-reference/sql/use.html
https://docs.snowflake.com/en/user-guide/data-sharing-intro.html#how-does-secure-data-sharing-work
https://docs.snowflake.com/en/sql-reference/name-resolution.html
https://docs.snowflake.com/en/user-guide/sample-data-using.html#querying-tables-and-views-in-the-sample-database
I just tried setting up Azure SQL data sync's sync group using sample Azure SQL database. I am syncing dbo.BuildVersion table of the sample database.
I get the following error on member database.
Database provisioning failed with the exception "Incorrect syntax near the keyword 'NOT'.Inner exception: SqlException ID: 39f49622-6a56-4a44-8e55-2a646f99a584, Error Code: -2146232060 - SqlError Number:156, Message: SQL error with code 156 For more information, provide tracing ID ‘679953bc-7dac-4490-89e9-ea6d145d0442’ to customer support."
How should I resolve this issue?
Thanks
I am able to resolve this issue by creating empty table in the member database first and then running the sync.
Does Sync service not create table when table does not exist in the member database?
It does create it, however, under certain circumstances it fails to create it do to some issue with the schema itself. Therefore, the workaround, as you figured out, is to create the table manually.
We have a Snowflake database that connects to a Shared View from PlayFab (for game events etc.) Stored procedures run daily via scheduled tasks to copy the latest data from the view into our own 'local' Snowflake table. It's been working fine, but today we're getting the following error trying to read from the PlayFab View:
Error: 100183: SQL compilation error: Failure during expansion of view 'PLAYFAB_ARCHIVE_SHARED': SQL compilation error: Object 'REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER' does not exist or not authorized.
I can't find any mention of the error number or REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER in the documentation. I believe error 100183 relates to a problem in a stored procedure, but I don't think it's my procedure, since I get the same error running a simple query from the PLAYFAB_ARCHIVE_SHARED view manually. I've checked the data from the PlayFab side, and it exists there. I'm not really sure whether the problem is Snowflake or PlayFab, but because of the error code, I suspect Snowflake.
I'm trying to get a direct support answer, but that doesn't seem to be happening for some reason. Anybody experienced this before?
PlayFab had mistakenly removed access to the view. Snowflake support confirmed that they could not find the view REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER. After contacting PlayFab support, they re-enabled the shared view and Snowflake access is now working again.
In past I have faced similar error on view, Its because of the access could you run grant access on the stored procedure to your role.
I was forwarded a Crystal Reports error message that said:
Failed to retrieve data from the database. ... Description: The EXECUTE permission was denied on the object 'xxxx_IDList', database 'DBName', schema 'dbo'.
There is an 'object?' named 'xxxx.IDList' under User-Defined Table Types - in the database.
I have never created or used a User-defined Table Type so I am just trying to figure out how to approach this error and how I might proceed with troubleshooting it.
I am hoping this is not an uncommon error.
Can anyone suggest an approach to solving this problem?
Thanks in advance!
In SQL server, any table that is not a system table is a user-defined table. So, anything in a typical non-system database that holds business data. The error message tells me that you have a database (dbname) on the server you are connecting to. In that database there is at least one schema (dbo, which is the default) and that the table xxxx_IDList lives in that schema.
Your app is trying to execute this table as if it was a function or stored procedure and you do not have permission to do that.
Do you have the source for the app that we can look at?