"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!

12 comments
Comment actions Permalink

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

 

1
Comment actions Permalink

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
Comment actions Permalink

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

1
Comment actions Permalink

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!

1
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Nice, thanks.  That did it!

1
Comment actions Permalink

The user interface for this feature is badly broken.

2
Comment actions Permalink

Please attach a screenshot of this

0
Comment actions Permalink

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.