Ill-formed date/time literals
Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2.
Example (MySQL):
SELECT TIME '10 -12:13:14' FROM dual;
SELECT TIME ' 12 : 13 : 14 ' FROM dual;
SELECT TIME '12 13 14' FROM dual;
SELECT TIME '12-13-14' FROM dual;
SELECT TIME '12.13.14' FROM dual;
SELECT TIME '12:13:' FROM dual;
SELECT TIME '12:13' FROM dual;
SELECT TIME '12:' FROM dual;
In this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted. For more information about date and time literals in MySQL, see Date and Time Literals at dev.mysql.com.
The following date and type literals are valid for MySQL.
SELECT TIME '12:13:14' FROM dual;
SELECT TIME '12:13:14.555' FROM dual;
SELECT TIME '12:13:14.' FROM dual;
SELECT TIME '-12:13:14' FROM dual;
SELECT TIME '10 12:13:14' FROM dual;
SELECT TIME '-10 12:13:14' FROM dual;
Inspection Details | |
---|---|
Available in: | AppCode 2023.3, CLion 2023.3, DataGrip 2023.3, DataSpell 2023.3, GoLand 2023.3, IntelliJ IDEA 2023.3, JetBrains Rider 2023.1, PhpStorm 2023.3, PyCharm 2023.3, Qodana for .NET 2023.1, Qodana for JVM 2023.3, Qodana for PHP 2023.3, Qodana for Ruby 2023.3, RubyMine 2023.3 |
Plugin: | Database Tools and SQL, 233.SNAPSHOT |
Last modified: 13 July 2023