SQL可移植性陷阱 [英] SQL portability gotchas

查看:83
本文介绍了SQL可移植性陷阱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司让我为Python ORM完成Oracle的后端.即使对于简单的东西,RDBMS在做事上的差异也让我感到惊讶.我已经学到了很多有关Oracle与其他RDBMS之间的区别的知识.出于好奇,我想了解更多.

My company has me working on finishing a back end for Oracle for a Python ORM. I'm amazed at how much differently RDBMSes do things even for the simple stuff. I've learned a lot about the differences between Oracle and other RDBMSes. Just out of sheer curiosity, I'd like to learn more.

就将SQL从一个平台移植到另一个平台而言,有哪些常见的陷阱"?

What are some common "gotchas" in terms of porting SQL from one platform to another?

请,每个答案只有一个陷阱.

推荐答案

Oracle游标似乎没有问题,它们在SQL Server中是一个巨大的性能问题.

Oracle does not seem to have a problem with cursors, they are a huge performance problem in SQL server.

实际上,几乎所有性能调优都是特定于数据库的(这就是为什么ANSII标准代码与针对特定于SQL的特定于数据库的SQL设计的更好方法相比通常性能很差的原因).

Actually pretty much all performance tuning is database specific (which is why ANSII standard code often performs very poorly compared to the better methods designed into the specifc flavor of SQL that is database specific).

日期似乎又是另一回事,因为数据库之间的差异很大.

Dates are another thing that seem to be handled very differntly from database to database.

数据类型也不相等.趋于吸引SQL Server新手的一件事是,时间戳数据类型与日期和时间完全无关,并且不能转换为数据时间值.

Datatypes are not equivalent either. One thing that tends to get newcomers to SQL Server is that timestamp data type has absolutely nothing to do with dates and times and cannot be converted to a datatime value.

这篇关于SQL可移植性陷阱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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