MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

cant use values in cte #416

Closed magiva closed 8 months ago

magiva commented 10 months ago

if i do this

    SELECT *
    FROM (VALUES
        ('M', 'B', '6152-000358'),
        ('M', 'B', '6152-000530'),
        ('M', 'B', '6152-000531'),
        ('B', 'C', '97048786'),
        ('C', 'D', '35528661'),
        ('A', 'B', '97680998')
    ) AS source_data (Column1, Column2, Column3)

then it shows table data, all good if i then wrap it into a cte

WITH source_data_cte AS (
    SELECT *
    FROM (VALUES
        ('M', 'B', '6152-000358'),
        ('M', 'B', '6152-000530'),
        ('M', 'B', '6152-000531'),
        ('B', 'C', '97048786'),
        ('C', 'D', '35528661'),
        ('A', 'B', '97680998')
    ) AS source_data (Column1, Column2, Column3)
)

SELECT * 
FROM source_data_cte;

I have 2 issues 1) i must specify the column names, i cant use select * 2) if i use a lot of rows (10k+) in the cte, it crashes the whole xrmtoolbox