为什么将Oracle表/列/索引名称限制为30个字符? [英] Why are Oracle table/column/index names limited to 30 characters?

查看:529
本文介绍了为什么将Oracle表/列/索引名称限制为30个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以理解,很多年前会有这种限制,但是如今可以肯定的是,可以很容易地增加这种限制.我们有对象的命名约定,但是总有一种情况会达到这个极限,特别是在命名外键时.

实际上有人知道为什么它不是更大吗?还是11g更大?


显然,答案是它将破坏当前没有防御性编码的脚本.我说这是一件非常令人担忧的事情,Oracle试图成为 数据库,这肯定是您必须不断改进的事情,否则您的产品将死掉一千次. /p>

每当我在公司内部看到这种异议时,我认为是时候该硬着头皮整理一下.如果人们运行的是他们在升级Oracle版本时不检查或维护的脚本,那么他们将遭受这种选择的后果.给他们提供一个兼容性标志,大小最大为4000,然后为我节省创建对象的浪费时间,这些对象必须不断地计数到30来检查名称是否为"OK".

解决方案

我相信这是ANSI标准.

实际上,我认为这是SQL-92标准.

该标准的更高版本似乎可以有选择地允许使用128个字符的名称,但是Oracle尚不支持(或允许部分字符支持,因为它允许30个字符.嗯.)

在此页面上搜索"F391,长标识符" ... http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/ap_standard_sql001.htm

(正在寻找参考)

I can understand that many years ago there would be this kind of limitation, but nowadays surely this limit could easily be increased. We have naming conventions for objects, but there is always a case that turns up where we hit this limit - especially in naming foreign keys.

Does anybody actually know why this isn't a bigger size - or is it bigger in 11g?


Apparently the answer is that it will break currently scripts that aren't defensively coded. I say that is a very worrying thing, Oracle is trying to be the database, surely this is the kind of thing that you must constantly improve, otherwise your product will die the death of a thousand cuts.

Whenever I see this kind of objection in-house, I think it is time to bite the bullet and sort it out. If people are running scripts that they do not check or maintain when they upgrade Oracle versions, then let them suffer the consequences of that choice. Provide them a compatibility flag, up the size to 4000, then save me the wasted time when I'm creating objects of having to constantly count to 30 to check the name is 'OK'.

解决方案

I believe it's the ANSI standard.

EDIT:

Actually, I think it's the SQL-92 standard.

A later version of the standard appears to optionally allow for 128 character names, but Oracle doesn't yet support this (or has partial support for it, insofar as it allows 30 characters. Hmmm.)

Search for "F391, Long identifiers" on this page... http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/ap_standard_sql001.htm

(Looking for a ref)

这篇关于为什么将Oracle表/列/索引名称限制为30个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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