"Unable to resolve column" inspection error in DB console

Since a recent update, I noticed all of my column names generate an inspection error of "Unable to resolve column..." in my DB consoles.  The queries work fine when run, it's just the inspection which thinks something is incorrect.

This is with an IBM DB2 (JTOpen) connection on 2019.1.2

Besides suppressing this particular inspection, is there a way to get my DB consoles to see my column names? 

Many thanks!

6
12 comments

Try mapping your project to a correct schema at File | Settings | Languages & Frameworks | SQL Resolution Scopes

 

8

I'm not sure if I'm doing this correctly.  It's asking for a path (would that be the path to the root of my project?) and then has a field for "Resolution Scope".  But it won't let me select anything other than "<Default> (<Everything>)" which doesn't enable the "Apply" button and results in nothing being saved.

Please note, it's not SQL within my project I'm trying to fix these inspection errors for.  It's in the database console where I write adhoc SQL queries.   

1

You can change the "<Default> (<Everything>)"  this way:

6

Ah okay, I had to manually uncheck "All Roots" in order to make a different selection.  

Now that that's figured out, the only option I have is "All Schemas".  I went into the DB connection properties and selected the relevant Schemas it should use, but they still don't show up.  When I make the selection of "All Schemas", I still get the inspection errors in the DB console.

  

Also, I don't quite follow why the database needs to be mapped to a particular folder.  I just want to confirm where I'm getting these inspection errors to ensure we're on the same page.  It is in the DB console for ad-hoc queries:

The column names and schema qualifiers are what's generating the inspection errors.

 

Many thanks for your help so far!

2

Just landed here via my favourite search engine. I've got exactly the same issue, with the exception that I'm using Idea not PhpStorm.

@Dmitry I followed your steps and hit 'OK' in the Settings dialog, but IntelliJ loses the setting. Do you want me to start a new thread for IntelliJ Idea or is this OK here?

What happens is this:

  1. I set up the connection data source in the Database tool window and I can execute SQL
  2. In my DB2 console and SQL files, IntelliJ doesn't recognise the column names and marks them all red
  3. I followed your instructions in the Settings->Languages & Frameworks->SQL Resolution dialog to select the DB2 schema out of the dozens in the list
  4. That Project Mapping is accepted by IntelliJ and I can close and re-open the dailog and it is still there
  5. This doesn't help name resolution in my project, even though the dialog states "for current project".
  6. If I try to enter a path to set the resolution scope, the path will appear in the dialog, but the 'Apply' button is not enabled, and if I click 'OK', the config setting is lost when I re-open the dialog.

Any more advice?

This is 2019.1 Ultimate

 

and when I re-open the Settings dialog, the mapping paths list is empty again.

1

Hi @Dmitry, please advise what else I should be checking in order to fix the inspection of these column and library names.  I'm unsure of what else to check.

1

Nice, thanks.  That did it!

1

The user interface for this feature is badly broken.

3

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003671819/comments/360000499640

 

I'm not able to uncheck "All Roots" and select my db. Any idea why?

0

Please attach a screenshot of this

0

You can also click on that menu and waiting for all table routines fetched, all warning error will be disappeared.

 

 

0

Please sign in to leave a comment.