2 comments
Comment actions Permalink

DataGrip cannot resolve column name from temp table if this column name declared in `AS` clause:

```

CREATE TEMP TABLE sourceSystem AS
WITH d (
"ObjectTypeName",
"SourceSystem"
) AS (
VALUES ('KsuNsiRequestIntegration', '1С КСУ НСИ'),
('AstueRequestIntegration', 'АСТУЭ'),
('ChessRequestIntegration', 'Шахматка / Техрежим'),
('MechfundRequestIntegration', 'ЭРА.Мехфонд'),
('OisUsoiHistoryRequestIntegration', 'OIS УСОИ'),
('OisUsoiRequestIntegration', 'OIS УСОИ')
)
SELECT bi."Oid" AS "Integration",
d."SourceSystem"
FROM d
INNER JOIN "XPObjectType" t ON REVERSE(SPLIT_PART(REVERSE(t."TypeName"), '.', 1)) = d."ObjectTypeName"
INNER JOIN "BasicIntegration" bi ON bi."ObjectType" = t."OID"
WHERE bi."GCRecord" IS NULL;

```

In the following case warning disappeared

```

CREATE TEMP TABLE sourceSystem("Integration", "SourceSystem") AS

```

0

Please sign in to leave a comment.