good idea try to write only ANSI SQL? Use online SQL Validator? Is there a local tool? [message #619326] |
Mon, 21 July 2014 08:52  |
 |
rc3d
Messages: 213 Registered: September 2013 Location: Baden-Württemberg
|
Senior Member |
|
|
Hi
Oracle was my first RDBMS. I write (for example) TO_NUMBER/TO_CHAR/TO_DATE instead of ANSI SQL CAST. Simply because I didn't know.
Does it make sense if I will write only ANSI SQL? Even when Oracle only?
I found a Slashdot Story from 2002 with online SQL validator: http://developers.slashdot.org/story/02/02/19/1720246/sql-validator -> http://developer.mimer.com/validator/index.htm
Quote:
Mimer SQL Validator
Ensure that You Maintain Portability
All too often people find themselves locked into a specific DBMS because their SQL code doesn't conform to the SQL standard.
Here at Mimer Information Technology, we pride ourselves on conforming to the SQL standard and we play an active role in the Database Languages standardization group which determines exactly what is SQL standard. For further information, see our specific SQL standard page.
You can be certain that your SQL conforms to SQL standards by using our unique Mimer SQL Validators.
Mimer SQL Validators
Many applications lack portability between different DBMS products due to vendor-specific lock-ins! By using our on-line Mimer SQL Validators, you can easily verify that your SQL statements conform to the SQL standard.
Mimer SQL Validator provides you with vital information on your SQL code. Does it conform to Core SQL? Does it use features outside Core SQL? Is your SQL statement incorrect or incomplete? Mimer SQL Validator gives you the low down on your code and helps you by providing a list of lexical units (tokens) and a suggested correction. Also, use the validator to find out exactly which words are vendor-reserved.
You are welcome to use our validator products below!
The validator looks "shitty" and is only available in the cloud. Is there a local alternative? Maybe even solution from Oracle? In future I need to work with MySQL (even later MariaDB) and Oracle Server.
|
|
|
|
Re: good idea try to write only ANSI SQL? Use online SQL Validator? Is there a local tool? [message #619331 is a reply to message #619326] |
Mon, 21 July 2014 10:19  |
 |
Michel Cadot
Messages: 68510 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Quote:Does it make sense if I will write only ANSI SQL? Even when Oracle only?
No.
TI_NUMBER, TO_CHAR, TO_DATE are NOT the equivalent to CAST.
Example:
SQL> select cast('10-DEC-2014' as date) from dual;
select cast('10-DEC-2014' as date) from dual
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
SQL> select to_date('10-DEC-2014','DD-MON-YYYY','nls_date_language=american') from dual;
TO_DATE('10-DEC-201
-------------------
10/12/2014 00:00:00
|
|
|