Temporary view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2025 12:13 PM
Hi,
I wrote a query to create temp view in my catalog, query execution was successful and returned the result as 'OK' in SQL editor window. However, when I executed the command 'Show Tables' and' Select * {temp_view}', it's not identifying the view. What could have gone wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2025 12:49 PM
hi @y_sanjay
Thank you for reaching out.
Temporary views are only usable in the scope of the notebook or SQL session where you defined them, then they are dropped after the session ends.
You may want to use "SHOW VIEWS" instead that also shows temporary views, but again, in the same session to reflect the results; otherwise, it won't be visible.
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2025 12:58 PM - edited 09-24-2025 01:01 PM
Hi @y_sanjay ,
I guess that is somehow related to how sessions are managed within SQL Editor. For instance when I ran following queries in SQL Editor all at once it worked and I've got 3 result sets:
1) First result set with OK status - which means that my view was successfuly created
2) Second result set associated with my SELECT * FROM employees view
3) And the last one associated with SHOW VIEWS;
Now, when I try to execute this code one statement at the time I've got the same error as you:
Now, in the documentation they mentioned that temporary views are visible only to the session that created them and are dropped when the session ends. So that could suggest that in SQL Editor every query rans in new session or there is some kind of bug.
Because if I try to execute the same kind of code on the same kind of compute within notebook - there's no such an issue: