Oracle 中的标识符太长

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19018396/
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 01:57:16  来源:igfitidea点击:

Identifier too long in Oracle

sqloracle

提问by Danielesk

I'm trying to create a table in SQL Developer but I get this error:

我正在尝试在 SQL Developer 中创建一个表,但出现此错误:

Error SQL: ORA-00972: Identifier too long

错误 SQL:ORA-00972:标识符太长

CREATE TABLE PACIENTE (
    IdentificacionID number(5),
    TipoIdentificacionID number(5),
    Nombre varchar(30),
    Apellido varchar(30),
    NumeroHistoriaClinica number(5),
    FechaNacimiento DATE,
    CiudadID number(5),
    SexoID number(5),
    EstadoCivilID number(5),
    OcupacionID number(5),
    NivelEscolaridadID number(5),
    EPSID number(5),
    IPSID number(5),
    Direccion varchar(30),
    Telefono number(10),
    AntecedentesFamiliares varchar(30),
    IndAntecedenteFamiliarTromboembolico varchar(1)
);

I tried to change the values of the varcharbut it didn't work.

我试图改变的值,varchar但没有奏效。

What is the problem?

问题是什么?

回答by buzzsawddog

You can not have greater than 30 characters for your identifier. Just a quick count looks like IndAntecedenteFamiliarTromboembolicois your offender. It is 36 characters long.

您的标识符不能超过 30 个字符。只是快速计数看起来IndAntecedenteFamiliarTromboembolico是你的冒犯者。它有 36 个字符长。

回答by Hedego

Given the answer by #buzzsawddog, I would suggest you shorted your identifier name to something such as: IndAntcdntFmlrTrmbmblc (which will be around 22).

鉴于#buzzsawddog 的回答,我建议您将标识符名称缩短为诸如:IndAntcdntFmlrTrmbmblc(大约为 22)。