Notebook's Widget parameters in SQL cell => howto

yopbibo
Contributor II
dbutils.widgets.text('table', 'product')
 
%sql
select *
from ds_data.$table

Hello, the above will work.

But how can I do something like:

dbutils.widgets.text('table', 'product')
 
%sql
select *
from ds_data.$table_v3

in that example, $table is still my table name, and I want to add a suffix.

I could go in python

dbutils.widgets.text('table', 'product')
tab = dbutils.widgets.get('table')
spark.sql(f'select * from ds_data.{tab}_v3')

but would love doing it in SQL.

Any idea?

thanks!