idea SQL dialect is not configured in mybatis - intellij-idea

SQL dialect is not configured
this is mine mapper.xml,i want to clear Warning

Anytime you get the light bulb, if you hit AltEnter / ⌥↵ you will most often get a list of quick-fixes (or intentions). In this case you will should get an option to inject the language, or to edit the language injection settings. It's not clear what type of file you are editing in your screenshot (it's obviously some type of XML like markup). So I'm not 100% sure which quick fix (if any) will be available in that context.
You can also take a look at this SO answer -- https://stackoverflow.com/a/30759243/1348743 -- of mine as it provides a lot more detail about other ways of configuring SQL dialects. Also look at the IntelliJ IDEA help documentation on Using Language Injections.

idea -> setting -> SQL dialect
sql dialect
see the right column 'sql dialect',default value is 'Generic'.
change it to your own db name

Related

IntelliJ IDEA cannot format SQL code properly

I have reinstalled the last version of IntelliJ IDEA and then when I try to format an SQL file, it orders all the lines as shown on the image.
However, I have not made any settings for SQL formatting in the previous versions and the format was OK as shown on my current setting preview as shown below:
So, is there anything default to format SQL properly? There are lots of choices in the settings, but I just want to use a default one available on the settings (I tried but it format almost the same).
Faced same issue. Settings/Languages&Frameworks/SQL Dialects, there you can find the dialect of file. Change it to what you use.
That's how I solved problem, even though you apply global or project SLQ Dialect, somehow the file may not be updated.
As you see from the image, Generic SQL causes problem here.

Turn off Database Navigator suggestions that my sql is bad

I'm using this plugin for intelliJ
Database Navigator
I just wanted a simple tool to check my sqlite database, now that the firefox plugin I use is no longer working with the latest firefox update.
Sad!
Anyway, the plugin is good... except it seems to have added it's own "clever" sql checker, that finds all the sql in my java files, and then tells me if there are problems with the sql.
All well and good, but this
slows down editing those java files
doesn't work, finding phantom errors
isn't needed. Who struggles with writing sql?
So right now I have a bunch of red "tick" marks down the side of any java file with sql in it, as the plugin imagines up issues where there are none. I'd like these to just go away, I don't need code telling me if my code works - any ideas
how?
Here is an example of this thing:
I don't want the sql "string" to be treated as special, I don't want "analysis" performed on it, I can write working SQL.
Every time i load this class, the ... whatever it is takes up time looking at all the strings, and then makes EVERYTHING red on the sidebar. I don't want to disable all inspections on this page, as I do like to see when my java code has an error.
I know it is possible to tell intellij to stop looking at strings, I had this setting before - and then my laptop was stolen, thank you thieves - and now I have setup my environment again, I don't have my notes on how to resolve this issue.
The strings are "analyzed" when they are used in some methods of the package java.sql.
Click on a string and press Alt+Enter to expand the suggestion list
Select "Language Injection Settings" to open the configuration dialog for "SQL"
Uncheck all the checkboxes, press "OK" and all errors must be gone
Technical note: Settings are stored in <USER>/<.IDE_VERSION>/config/options/IntelliLang.xml

IntelliJ IDEA doesn't understand Hibernate Query Language (HQL)

When I work with HQL in IntelliJ IDEA it always highlights my Hibernate queries:
I know the way how I can disable that highlighting, that is already described here.
But I want to know is there a support of HQL in IntelliJ IDEA? Is there any way to use something like query auto-completion?
Maybe an option in settings or some plugin.
Jetbrains / Intellij provides coding assistance, such as syntax highlighting, in string literals via Language Injection.
You can set the language to be injected via Settings > Editor > Language Injections.
In your case you need to set the language for org.hibernate.Session to Hibernate QL / HQL. I had to do the same thing for javax.persistance.EntityManager.
Here is what for me resolve the same issue: Open in the IDEA Preferences (Settings)/Editor/Language Injections and under the list of languages find Session (org.hibernate). Under the column Language, it should be selected Hibernate QL. Double click on it and a list of operations will be displayed. Select the operations that you need.

Oracle SQL Automation

I have a question regarding Automation.In my project we have 35 SQL scripts with same logic,same scripts for all those, with only 4 parameters different how can i automate these in TOAD for Oracle?
Depending on your version of Toad, there could be a 'Automation Designer' under the 'Utilities' menu item. This will allow you to run scripts automatically, based on a bit of logic. It also supports running with parameters.
The tool 'Toad for Data Analysts' can also be used to model automated scripts, and run them with specific parameters.
If you have any of these tools available, I would suggest giving them a try, or at least read up on their documentation. If you don't have access to these, let me know so I can try and think of a different solution.

How do I compile Oracle SQL scripts?

I have a series of SQL files, and I want to compile all of them. If do them manually by using benthic software, it takes a long time. I tried using TOAD, but I don't like to use cracked software. Can you help me execute a SQL file? I want to write a program to do some things for me.
From sql/plus I tried to create batch file but in some of my sql file developer used "/" and ";" so it caused sql/plus suddenly stopping the compilation. Please advise or recommend free software to help.
"I want apply the sql package , function and if they are invalid compile them again"
I am using oracle 10g.
Thanks
If you search for something like TOAD, try SQL Developer, a free tool from Oracle.
If you want to recompile existing source in your database, you can use dbms_utility.compile_schema.
If you try to install several files in a batch, SQL*Plus should work for you. Make sure that your files have the right format.
It sounds like you need to run a large sql script. Correct? Sql/Plus should work, but if you want a free IDE, I recommend SQL Developer. It isn't perfect, but it is one of the better free solutions.
"in some of my sql file developer used "/" and ";" "
You need to consistently use these to have any hope of using a tool to deploy. You don't want to have to use a GUI to deploy, so SQL*Plus is the standard to aim for. A good Oracle GUI should be able to run a SQL*Plus deployment script.
I generally start with SET DEFINE OFF otherwise unexpected ampersands (&) cause issues.
Do some basic grepping - any script with a CREATE PACKAGE, CREATE PROCEDURE, CREATE TRIGGER or CREATE TYPE (including CREATE OR REPLACE) should have a the "/" to execute that statement. If they don't, fix them.
For a first run though, I'd take them in batches of 10, until I was sure that they executed correctly. I wouldn't worry about compilation errors as long as they load. Afterwards, you can do a recompile of any invalid objects in the schema.
Then check USER_ERRORS to see what is still broken.