Insert statement bug

Answered

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?

3 comments
Comment actions Permalink

@Nicolas,

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

0
Comment actions Permalink

Vasily,

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.

1
Comment actions Permalink

2) I can't reproduce

 

There is an issue https://youtrack.jetbrains.com/issue/DBE-8924 that looks similar.

0

Please sign in to leave a comment.