oracle 表名超过 30 个字符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8701479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 00:31:37  来源:igfitidea点击:

Table Name with more than 30 characters

sqloracleoracle11g

提问by aF.

I have a table in a MySQL database. The name of the table is more than 30 characters long and I want to make the same table in Oracle 11g, but Oracle only allows tables with a maximum of 30 characters in the name.
I can't change the name of the table to make it less than 30 charachters, because the system is based on these tables, and it will cost me a lot if I change the name, so changing the table name is not the answer I am looking for.

我在 MySQL 数据库中有一个表。表名长度超过30个字符,我想在Oracle 11g中制作相同的表,但Oracle只允许名称最多包含30个字符的表。
不能把表名改到30字以内,因为系统是基于这些表的,改名要花不少钱,所以改表名不是我的答案我在找。

There is a table called user_tables, and when I describe the table it says the the table_namefield has a datatype varchar2(30), so I tried to alter the table and make the table_name varchar2(255)but I couldn't, it gives me an error saying:

有一个名为 的表user_tables,当我描述该表时,它说该table_name字段具有一个数据类型varchar2(30),因此我尝试更改该表并创建该表,table_name varchar2(255)但我不能,它给了我一个错误消息:

ORA-00942: table or view does not exist

ORA-00942: 表或视图不存在

I am connect as sys.

我连接为sys.

Does anyone know how to solve my problem?

有谁知道如何解决我的问题?

回答by aF.

All Oracle identifiers are limited to 30 characters.There is no option that lets you change that.

所有 Oracle 标识符都限制为 30 个字符。没有任何选项可以让您改变它。

回答by xQbert

Synonyms will NOT work: source. Limits of 30 are hard and fast.

同义词不起作用:source。30 的限制是艰难而快速的。

EDIT: After continued research oracle docsUnless java is in place here per comments even a synonym will not work to allow the exceeding of 30 characters.

编辑:在继续研究oracle 文档之后,除非每个评论都在此处安装了 java,否则即使是同义词也无法允许超过 30 个字符。

Long story Short: You can't do what you want to do in the oracle environment.

长话短说:你不能在 oracle 环境中做你想做的事。