Microsoft T-SQL到Oracle SQL的转换 [英] Microsoft T-SQL to Oracle SQL translation

查看:69
本文介绍了Microsoft T-SQL到Oracle SQL的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用T-SQL多年了,但是我已经搬到一个组织,该组织将需要编写一些Oracle东西,至少只是简单的CRUD操作,直到我找到我的脚.从应用程序开发的角度来看,我不会仅与现有的Oracle数据库进行交互就将数据库从一个迁移到另一个.有没有可以轻松地将T-SQL转换为Oracle SQL的工具或实用程序,关键字映射器就是我想要的东西.

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.S.我对RTFM太懒了,除了它不会在我的角色中扮演很大的角色,所以我只希望有一些东西可以让我加快速度.

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.

推荐答案

与逻辑差异相比,到目前为止列出的语言差异无关紧要.任何人都可以查找NVL.很难查找的是

The language difference listed so far are trivial compared to the logical differences. Anyone can lookup NVL. What's hard to lookup is

DDL

在SQL Server中,您可以在任何地方,任何时间,几乎没有大惊小怪的情况下操作模式.

In SQL server you manipulate your schema, anywhere, anytime, with little or no fuss.

在Oracle中,我们不喜欢存储过程中的DDL,因此您会遇到麻烦.您需要使用EXECUTE IMMEDIATE来执行DDL功能.

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.

临时表

在SQL Server中,当逻辑变得有点困难时,通常的做法是将sql快捷方式并将其解析为临时表,然后使用该临时表完成下一步. 使用MSSS可以很容易地做到这一点.

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. MSSS makes it very easy to do this.

在Oracle中,我们不喜欢这样.通过强制执行中间结果,可以完全阻止优化器为您找到快捷方式.但是,如果您必须中途停止并保持中间结果,Oracle希望您提前而不是即时地制作临时表.

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.

在MSSS中,您担心锁定,没有适用于DML的锁定提示,具有锁定升级功能以减少锁定次数.

In MSSS you worry about locking, you have nolock hints to apply to DML, you have lock escalation to reduce the count of locks.

在Oracle中,我们不必担心这种情况.

In Oracle we don't worry about these in that way.

已提交阅读

直到最近,MSSS仍未完全处理读取已提交"隔离,因此您担心读取不干净.

Until recently MSSS didn't fully handle Read Committed isolation so you worried about dirty reads.

甲骨文已经有几十年了.

Oracle has been that way for decades.

MSSS没有位图索引,IOT,表群集,单表哈希群集,强制唯一约束的非唯一索引等概念.

MSSS has no concept of Bitmap indexes, IOT, Table Clusters, Single Table hash clusters, non unique indexes enforcing unique constraints....

这篇关于Microsoft T-SQL到Oracle SQL的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆