Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:43 PM
Another option is demonstrated by this example:
%sql
SET database_name.var = marketing;
SHOW TABLES in ${database_name.var};
SET database_name.dummy= marketing;
SHOW TABLES in ${database_name.dummy};- do not use quotes
- use format that is variableName.something and it will work in %sql. I don't know why. I attached an example from my environment. I redacted names and data, but you can see that it works with .var and .dummy. You'll have to trust that I didn't use quotes
FYI: Widget Documentation explains in the blue Note that using the widget method will not work when you Run All or run from another notebook: Databricks widgets | Databricks on AWS