Syntax error: got ;

The problem I’m having

Syntax error: Expected “)” but got ;

The context of why I’m trying to do this

want to create a columns to combine it with another table

What I’ve already tried

Chatgpt lol

Some example code or error messages

{{ config(
    tags=["PII", "LAGERL23B"],
    materialized="table",
) }}

WITH
    -- Quell-Daten laden und alle Transformationen in einer einzigen CTE durchführen
    Extraktion_Details AS (
        SELECT 
            Artikelfarbennummer,
            FORM8,
            CONCAT(
                SUBSTRING(CAST(Artikelfarbennummer AS STRING), 1, 2), '-', 
                SUBSTRING(CAST(Artikelfarbennummer AS STRING), 3, 4), '/', 
                SUBSTRING(CAST(Artikelfarbennummer AS STRING), 7, 2)
            ) AS Artikelnummer,
            SUBSTRING(CAST(Artikelfarbennummer AS STRING), 7, 2) AS Farbnummer,
            SUBSTRING(CAST(Artikelfarbennummer AS STRING), 1, 6) AS Artikelnummer_ohne_Farbe,
            SUBSTRING(CAST(FORM8 AS STRING), 1, 2) AS PROD2
        FROM {{ ref("stg_LAGERL23B") }}
    ),
    
    -- Erstellen des Schlüssels in der LAGERL23B-Tabelle
    lagerl23b_source AS (
        SELECT 
            Artikelfarbennummer,
            FORM8,
            PROD2,  -- Verwendung von PROD2, das in der vorherigen CTE erstellt wurde
            CONCAT(PROD2, '_', 'dummy') AS PROD2_Kundennummer -- Dummy für Kundennummer
        FROM Extraktion_Details
    )

-- Finaler Output
SELECT *
FROM lagerl23b_source
LIMIT 10


Could you provide the compiled query by running dbt compile -s model_name ? This will generate the query that dbt executes on Snowflake.