<p>I've worked with T-SQL for years but I've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with existing Oracle databases from an Application Development perspective. Is there are tool or utility available to easily translate T-SQL into Oracle SQL, a keyword mapper is the sort of thing I'm looking for.</p>

<p>P.S. I'm too lazy to RTFM, besides it's not going to be a big part of my role so I just want something to get me up to speed a little faster.</p>

[{'answer_id': 41800, 'author': 'jodonnell', 'author_id': 4223, 'author_profile': 'https://Stackoverflow.com/users/4223', 'pm_score': 2, 'selected': False, 'text': '<p>It\'s not trivial to map them back and forth, so I doubt there\'s a tool that does it automatically.  But this link might help you out: <a href="http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm" rel="nofollow noreferrer">http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm</a></p>\n'}, {'answer_id': 41847, 'author': 'vzczc', 'author_id': 224, 'author_profile': 'https://Stackoverflow.com/users/224', 'pm_score': 2, 'selected': False, 'text': '<p>The most important differences for plain T-SQL are:</p>\n\n<ul>\n<li>NVL replaces ISNULL</li>\n<li>SYSDATE replaces GETDATE()</li>\n<li>CONVERT is not supported</li>\n<li>Identity columns must be replaced with sequences &lt;-- not technically T- or PL/ but just SQL</li>\n</ul>\n\n<p>Note. I assume you do not use the deprecated SQL Server *= syntax for joins</p>\n\n<p>@jodonell: The table you link to is a bit outdated, oracle has become somewhat more standards compliant after 9i supporting things like CASE and ANSI outer joins</p>\n'}, {'answer_id': 45918, 'author': 'ninesided', 'author_id': 1030, 'author_profile': 'https://Stackoverflow.com/users/1030', 'pm_score': 2, 'selected': False, 'text': "<p>If you replace your ISNULL and NVL nonsense with COALESCE, it'll work in T-SQL and PL/SQL!</p>\n"}, {'answer_id': 636537, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 5, 'selected': False, 'text': "<p>The language difference listed so far are <strong>trivial</strong> compared to the logical differences. Anyone can lookup NVL. What's hard to lookup is </p>\n\n<p><strong>DDL</strong></p>\n\n<p>In SQL server you manipulate your schema, anywhere, anytime, with little or no fuss.</p>\n\n<p>In Oracle, we don't like DDL in stored procedures so you have jump through hoops. You need to use EXECUTE IMMEDIATE to perform a DDL function.</p>\n\n<p><strong>Temp Tables</strong></p>\n\n<p>IN SQL Server when the logic becomes a bit tough, the common thing is to shortcut the sql and have it resolved to a temp table and then the next step is done using that temp table.\nMSSS makes it very easy to do this.</p>\n\n<p>In Oracle we don't like that. By forcing an intermediate result you completely prevent the Optimizer from finding a shortcut for you. BUT If you must stop halfway and persist the intermediate results Oracle wants you to make the temp table in advance, not on the fly.</p>\n\n<p><strong>Locks</strong></p>\n\n<p>In MSSS you worry about locking, you have nolock hints to apply to DML, you have lock escalation to reduce the count of locks.</p>\n\n<p>In Oracle we don't worry about these in that way.</p>\n\n<p><strong>Read Commited</strong></p>\n\n<p>Until recently MSSS didn't fully handle Read Committed isolation so you worried about dirty reads.</p>\n\n<p>Oracle has been that way for decades.</p>\n\n<p><strong>etc</strong></p>\n\n<p>MSSS has no concept of Bitmap indexes, IOT, Table Clusters, Single Table hash clusters, non unique indexes enforcing unique constraints....</p>\n"}, {'answer_id': 636547, 'author': 'Thomas Jones-Low', 'author_id': 23030, 'author_profile': 'https://Stackoverflow.com/users/23030', 'pm_score': 0, 'selected': False, 'text': '<p>If you\'re doing a one-off conversion, rather than trying to support two versions, you must look at <a href="http://www.oracle.com/technology/tech/migration/workbench/index_sqldev_omwb.html" rel="nofollow noreferrer">Oracle Migration Workbench</a>. This tool works with Oracle\'s SQLDeveloper (which you really should have if you are working with Oracle). This does a conversion of the schema, data, and some of the T-SQL to PL/SQL. Knowing both well, I found it did about an 80% job. Good enough to make it worth while to convert the bulk of procedures, and hand convert the remainder "tougher" unknown parts. </p>\n'}, {'answer_id': 1685994, 'author': 'Liao', 'author_id': 136089, 'author_profile': 'https://Stackoverflow.com/users/136089', 'pm_score': 0, 'selected': False, 'text': '<p>Not cheap ($995) but this tool works great: <a href="http://www.swissql.com/products/sql-translator/sql-converter.html" rel="nofollow noreferrer">http://www.swissql.com/products/sql-translator/sql-converter.html</a></p>\n'}, {'answer_id': 2663785, 'author': 'Tom Clark AaiCanHelp.com', 'author_id': 319846, 'author_profile': 'https://Stackoverflow.com/users/319846', 'pm_score': 2, 'selected': False, 'text': '<p>I have done a few SQL server to oracle migrations. There is no way to migrate without rewriting the backend code. Too many differences between the 2 databases and more importantly differences between the 2 mind sets of the programmers. Many managers think that the 2 are interchangeable, I have had managers ask me to copy the stored procedures from SQL server and compile them in oracle, not a clue! Toad is by far the best tool on the market for supporting an oracle application. SQL developer is ok but was disappointing compared to toad. I hope that oracle will catch their product up to toad one day but it is not there yet. Have a good day :) chances are if you are migrating to oracle it is for a reason and in order to meet that requirement you will need to rewrite the back end code or you will have many issues.</p>\n'}, {'answer_id': 2663815, 'author': 'Mark Breen', 'author_id': 319840, 'author_profile': 'https://Stackoverflow.com/users/319840', 'pm_score': 2, 'selected': False, 'text': '<p>I have to things to mention.</p>\n\n<p>1) When I worked on Oracle 8, you could not do "Select @Result", you had to instead use the dummy table as follows "Select @Result from dual".  Not sure if that ridiculousness still exists.</p>\n\n<p>2) In the Oracle world they seem to love cursors and you better read up on them, they use them all the time AFAICS.</p>\n\n<p>Good luck and enjoy,</p>\n\n<p>it is not that different to MS SQL.  Thankfully, I do not have to work with it anymore and I am back in the warm comfort of MS tools.</p>\n'}, {'answer_id': 2663830, 'author': 'Mark Breen', 'author_id': 319840, 'author_profile': 'https://Stackoverflow.com/users/319840', 'pm_score': 0, 'selected': False, 'text': '<p>A few people have mentioned here converting back and forward.  I do not know of a tool to convert from MSSQL to Oracle, but I used the free MS tool to convert a Oracle db to MSSQL and it worked for me and converted a large db with no problems I can call.  It is similar to the Access to MSSQL tool that MS also provide for free.  Enjoy</p>\n'}, {'answer_id': 4490401, 'author': 'tlhong', 'author_id': 548722, 'author_profile': 'https://Stackoverflow.com/users/548722', 'pm_score': 1, 'selected': False, 'text': '<p>In Oracle SQL Developer, there is a tool called Translation Scratch Editor. You can find it from Tools > Migration.</p>\n\n<p>The Oracle SQL Developer is a free download from Oracle and it is an easy install.</p>\n'}, {'answer_id': 8137736, 'author': 'Peter', 'author_id': 15349, 'author_profile': 'https://Stackoverflow.com/users/15349', 'pm_score': 4, 'selected': False, 'text': '<p>I get the impression most answers focus on migrating an entire database or just point to some differences between T-SQL and PL/SQL. I recently had the same problem. The Oracle database exists, but I need to convert a whole load of T-SQL scripts to PL/SQL.</p>\n<p>I installed <a href="https://www.oracle.com/tools/downloads/sqldev-downloads.html" rel="nofollow noreferrer">Oracle SQL Developer</a> and ran the <a href="http://www.oracle.com/technetwork/database/migration/scratchlauncher-098387.html" rel="nofollow noreferrer">Translation Scratch Editor</a> (Tools &gt; Migration &gt; Scratch Editor).</p>\n<p>Then, just enter your T-SQL, choose the correct translation in the dropdown-list (it should default to \'T-SQL to PL/SQL\'), and convert it.</p>\n'}, {'answer_id': 54420302, 'author': 'Lukas Eder', 'author_id': 521799, 'author_profile': 'https://Stackoverflow.com/users/521799', 'pm_score': 0, 'selected': False, 'text': '<p>jOOQ has a publicly available, free translator, which can be accessed from the website here: <a href="https://www.jooq.org/translate" rel="nofollow noreferrer">https://www.jooq.org/translate</a></p>\n\n<p>It supports DML, DDL, and a few procedural syntax elements. If you want to run the translation locally via command line, a license can be purchased and the command line works as follows:</p>\n\n<pre class="lang-none prettyprint-override"><code>$ java -cp jooq-3.11.9.jar org.jooq.ParserCLI -t ORACLE -s "SELECT substring(\'abcde\', 2, 3)"\nselect substr(\'abcde\', 2, 3) from dual;\n</code></pre>\n\n<p>See: <a href="https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/sql-parser-cli" rel="nofollow noreferrer">https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/sql-parser-cli</a></p>\n\n<p>(Disclaimer, I work for the vendor)</p>\n'}]
['https://Stackoverflow.com/questions/41781', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4403/']