filipniziol
Esteemed Contributor

Hi @StevenW ,

I see that you are using python noteboook and then the view is created in SQL.

1. If you are using %sql magic command then to use parameters you need to reference them like $parameter or :parameter (depending on the runtime).

filipniziol_0-1728401853970.png

2. If you are using spark.sql to run a query kept in string, then you need to remove $ and use standard string interpolation:

query = f"""
CREATE OR REPLACE TEMP VIEW f0010_view AS
SELECT
    TRIM(b.ccco) AS ccco,
    TRIM(b.ccname) AS ccname,
    TRIM(b.cccrcd) AS cccrcd,
    CAST(b.CCDFYJ AS INT) AS CCDFYJ,
    {wid_UnityCatalogName}.{wid_UnityCatalogBronzeJDESchema}.f_Convert_JDEJulian_ToDate(CAST(b.CCDFYJ AS INT)) AS FISCAL_YEAR_START_DT,
    b.CCPNC AS CCPNC
FROM some_table AS b
"""