Insert statement bug


I am using DataGrip 2019.2.4, Build #DB-192.6603.38 with Azure SQL Database.

Insert statements in stored procedures almost always show a warning that the select statement has fewer columns that the insert section (eg "13 values expected, got 12). The exception is when values are used (so no select). The warnings are always wrong.

This is really irritating and is slowing me down considerably.

I don't get this error with Oracle.

When will this bug be fixed?

Comment actions Permalink


Could you provide any samples for Azure and Oracle to reproduce the issue?

Comment actions Permalink


I can't provide samples of client data, but the Azure SQL Database issue arises when the select statement includes anything other than just column names.

So "insert table1 (a, b, c) select x, y, z from table2" is fine.

What fails is either:

1) insert table1 (a, b, c) select x, lots of inline code to do with y, z from table2

2) insert table1 (a, b, c) select x, someFunction(y), z from table2

DataGrip gets confused by the complexity associated with column y in my example and excludes it from its column count. Conversely, clicking on each column of the insert statement does highlight the correct column in the select statement, including the columns causing the warning.

This is a new bug.

My comment about Oracle may have been misleading as I only had a quick look at some code to see if was an issue.

Comment actions Permalink

2) I can't reproduce


There is an issue that looks similar.


Please sign in to leave a comment.