"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!
Please sign in to leave a comment.
Try mapping your project to a correct schema at File | Settings | Languages & Frameworks | SQL Resolution Scopes
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.
You can change the "<Default> (<Everything>)" this way:
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!
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:
Any more advice?
This is 2019.1 Ultimate
and when I re-open the Settings dialog, the mapping paths list is empty again.
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.
Please see https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003835720--Unable-to-resolve-column-inspection-error-in-DB-console - the problem was addressed following suggestions of a member of a corresponding team.
Nice, thanks. That did it!
The user interface for this feature is badly broken.
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?
Please attach a screenshot of this
You can also click on that menu and waiting for all table routines fetched, all warning error will be disappeared.