cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

I'm trying to create a table in databricks sql using widget values in table naming. The idea is that the users could select / enter table naming values as they create their tables. This can be done in notebooks but I can't get the syntax working in DBSQL.

Juha
New Contributor II

Here's an example:

CREATE OR REPLACE TABLE {{workspace}}.{{TableNameFirstPart}}_{{TableNameEndPart}}

AS SELECT ...

3 REPLIES 3

Ajay-Pandey
Esteemed Contributor III

Hi @Juha Leppรคnenโ€‹ please refer below code-

val = '2020-04-08'
 
spark.sql("SELECT * FROM MYTABLE WHERE TIMESTAMP  BETWEEN {}  AND '2020-04-08'".format(val)).show()

Juha
New Contributor II

Hi @Ajay Pandeyโ€‹  and thank you for your response, but this doesn't answer my question.

lawrence009
Contributor

Have you figured out what the problem was? Could the issue be permission related?