Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 456249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:27:08+00:00 2026-05-12T22:27:08+00:00

We use Oracle on a project and would like to also support MySQL. How

  • 0

We use Oracle on a project and would like to also support MySQL. How close are their SQL dialects?

Is it perhaps even possible to use the same SQL source for both without too many gymnastics?

Details:

  • We’re using iBatis, a persistence manager that cleanly segregates the SQL statements into resource files. But we work at the SQL level, which has its advantages (and disadvantages).
  • We’d prefer not to move to an object-relational mapper like Hibernate, which would fully shield us from dialect differences.
  • We’ve tried hard to keep to a generic subset of Oracle SQL.
  • There’s no PL/SQL.
  • We don’t use stored procedures or triggers (yet, anyway).
  • We use check constraints, unique constraints, and foreign key constraints.
  • We use ON DELETE CASCADEs.
  • We use transactions (done at the iBatis API level).
  • We call a few Oracle timestamp functions in the queries.
  • We would use the InnoDB storage engine with MySQL (it supports transactions and constraints).

So what are your thoughts? Would we need to maintain two different sets of iBatis SQL resource files, one for each dialect, or is it possible to have a single set of SQL supporting both MySQL and Oracle?

Final Update: Thanks for all the answers, and especially the pointers to Troels Arvin’s page on differences. It’s really regrettable that the standard isn’t more, well, standard. For us the issues turn out to be the MySQL auto-increment vs. the Oracle sequence, the MySQL LIMIT vs. the Oracle Rowumber(), and perhaps the odd function or two. Most everything else ought to transfer pretty easily, modulo a few edits to make sure we’re using SQL-92 as @mjv points out. The larger issue is that some queries may need to be hand-optimized differently in each DBMS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:27:09+00:00Added an answer on May 12, 2026 at 10:27 pm

    Expect a few minor bumps on the road, but on whole should be relatively easy.

    From the list of features you currently use, there should only be a few synctactic or semantic differences, in general easy to fix or account for. The fact that you do not use PL/SQL and/or Stored Procedures is a plus. A good rule of thumb is to try and stick to SQL-92 which most DBMSes support, in particular both Oracle and MySQL. (Note this is not the current SQL standard which is SQL-2008).

    A few of the differences:

    • “LIMIT” is a famous one: to limit the number of rows to retrieve in the results list, MySQL uses LIMIT n, at the end of the query, Oracle uses RowNumber() in the WHERE clause (which is pain, for you also need to reference it in the SELECT list…)
    • Some datatypes are different. I think mostly BOOLEAN (but who uses this 😉 ) Also some I think subtle differences with the DATETIME type/format.
    • Some function names are different (SUBSTRING vs. SUBSTR and such…)

    Just found what seems to be a good resource about differences between SQL implementations.

    Reading the responses from others, yeah, DDL, could be a problem. I discounted that probably because many applications do not require DDL, you just need to set the data schema etc. at once, and then just use SQL for querying, adding or updating the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use the WatchService API as mentioned in this link: http://download.oracle.com/javase/tutorial/essential/io/notification.html
I use oracle 10. I have update statement like that : update table1 t1
I have a SP in a package in Oracle 10g. I use Oracle SQL
In Oracle / SQL Server I can use the WITH keyword to define a
I use Hibernate on my Java project, I have Oracle DB. An ID column,
I have a project which needs to use NHibernate to communicate with my Oracle
I use Oracle's specific data provider (11g), not the Microsoft provider that is being
I have to use oracle database in android. I have tried to work as
I want to use the Oracle REGEXP_REPLACE to remove some dots from a String.
I'm trying to use cx_Oracle to connect to an Oracle instance and execute some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.