ODP.NET EFCore OracleException (0x80004005): ORA-00972 - identifier is too long — oracle-tech

    Forum Stats

  • 3,716,134 Users
  • 2,242,961 Discussions
  • 7,845,841 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

ODP.NET EFCore OracleException (0x80004005): ORA-00972 - identifier is too long

18d56f16-5b80-4617-bffb-d3ebc1d4e94b
edited March 2019 in ODP.NET

Hi,

I have started using EFCore driver and i'm having trouble with some queries because of the way the fields and table aliases are set based on the entity property name like "SequencialVinculacaoRecolhimento".

Here's one SQL generated that throws this error above...

SELECT "t0"."CDFORO", "t0"."CDCALCULO", "t0"."NUGRJEMITIDA", "t0"."CDFORO0", "t0"."CDCALCULO0", "HistoricosCalculoCusta"."FLCOBRAINTPRIPARC" "CobraIntegralPrimeiraParcela", "HistoricosCalculoCusta"."CDAGENTE" "CodigoAgente", "HistoricosCalculoCusta"."CDATOFORENSE" "CodigoAtoForense", "HistoricosCalculoCusta"."CDCALCULO" "CodigoCalculo", "HistoricosCalculoCusta"."CDFORO" "CodigoForo", "HistoricosCalculoCusta"."CDFOROLOCAL" "CodigoForoLocal", "HistoricosCalculoCusta"."CDGRUPORECOL" "CodigoGrupoRecolhimento0", "HistoricosCalculoCusta"."CDINDEXADOR" "CodigoIndexador", "HistoricosCalculoCusta"."CDLOCALIDADE" "CodigoLocalidade", "HistoricosCalculoCusta"."CDTIPOCONTA" "CodigoTipoConta0", "HistoricosCalculoCusta"."CDTIPOCUSTA" "CodigoTipoCusta", "HistoricosCalculoCusta"."CDTIPORECOL" "CodigoTipoRecolhimento", "HistoricosCalculoCusta"."CDUSUINCLUSAO" "CodigoUsuarioInclusao0", "HistoricosCalculoCusta"."DTCALCULO" "DataCalculo", "HistoricosCalculoCusta"."DTUSUINCLUSAO" "DataInclusao1", "HistoricosCalculoCusta"."DTVLUNITARIO" "DataValorUnitario", "HistoricosCalculoCusta"."DEOUTROS" "DescricaoOutros", CASE

          WHEN "HistoricosCalculoCusta"."CDGRUPORECOL" IS NULL

          THEN 1 ELSE 0

      END, "HistoricosCalculoCusta"."CDGRUPORECOL" "Codigo", "GrupoRecolhimento"."DTUSUINCLUSAO" "DataInclusao", "GrupoRecolhimento"."DEGRUPORECOL" "Descricao", "GrupoRecolhimento"."DERESUMIDAGRUPO" "DescricaoResumida", "GrupoRecolhimento"."DETECLAATALHO" "DescricaoTeclaAtalho", "GrupoRecolhimento"."CDUSUINCLUSAO" "UsuarioInclusao", "HistoricosCalculoCusta"."FLOPERACAO" "Operacao", "HistoricosCalculoCusta"."PEAPLICADO" "PercentualAplicado", "HistoricosCalculoCusta"."QTUNIDADES" "QuantidadeDeUnidades", CASE

          WHEN "HistoricosCalculoCusta"."FLRATEIO" = 'S'

          THEN 1 ELSE 0

      END "Rateio", "HistoricosCalculoCusta"."NUSEQRECOL" "SequencialRecolhimento", "HistoricosCalculoCusta"."NUSEQVINCRECOL" "SequencialVinculacaoRecolhimento", CASE

          WHEN "HistoricosCalculoCusta"."CDTIPORECOL" IS NULL

          THEN 1 ELSE 0

      END, "TipoRecolhimento"."CDGRUPORECOL" "CodigoGrupoRecolhimento", "TipoRecolhimento"."CDRECEITADARF" "CodigoReceitaDarf", "TipoRecolhimento"."CDRECEITAIRRF" "CodigoReceitaIrrf", "TipoRecolhimento"."CDTIPOCONTA" "CodigoTipoConta", "TipoRecolhimento"."CDUSUINCLUSAO" "CodigoUsuarioInclusao", "TipoRecolhimento"."DTUSUINCLUSAO" "DataInclusao0", "TipoRecolhimento"."DETIPORECOL" "Descricao0", "TipoRecolhimento"."DEBASELEGAL" "DescricaoBaseLegal", "TipoRecolhimento"."DEINSTTPRECOL" "DescricaoInstrucaoTpRecolhimento", "TipoRecolhimento"."FLDOCUMENTO" "Documento", "TipoRecolhimento"."FLFORAUSO" "ForaUso", CASE

          WHEN "TipoRecolhimento"."FLRECOLINTEGRAL" = 'S'

          THEN 1 ELSE 0

      END "RecolhimentoIntegral", "TipoRecolhimento"."TPINTEGRARECOL" "TipoIntegraRecolhimento", "TipoRecolhimento"."FLTRIBUTAIRRF" "TributaIrrf", "HistoricosCalculoCusta"."VLCALCULADO" "ValorCalculado", "HistoricosCalculoCusta"."VLCOMPLEMENTAR" "ValorComplementar", "HistoricosCalculoCusta"."VLEXCEDENTE" "ValorExcedente", "HistoricosCalculoCusta"."VLFATOR" "ValorFator", "HistoricosCalculoCusta"."VLFINAL" "ValorFinal", "HistoricosCalculoCusta"."VLINICIAL" "ValorInicial", "HistoricosCalculoCusta"."VLMAXIMO" "ValorMaximo", "HistoricosCalculoCusta"."VLMINIMO" "ValorMinimo", "HistoricosCalculoCusta"."VLUNITARIO" "ValorUnitario"

      FROM "ECCPCALCCUSTAHIST" "HistoricosCalculoCusta"

      INNER JOIN "ECCPTIPORECOL" "TipoRecolhimento" ON "HistoricosCalculoCusta"."CDTIPORECOL" = "TipoRecolhimento"."CDTIPORECOL"

      LEFT JOIN "ECCPGRUPORECOL" "GrupoRecolhimento" ON "HistoricosCalculoCusta"."CDGRUPORECOL" = "GrupoRecolhimento"."CDGRUPORECOL"

      INNER JOIN (

          SELECT "x1"."CDFORO", "x1"."CDCALCULO", "x1"."NUGRJEMITIDA", "x.CalculoCusta1"."CDFORO" "CDFORO0", "x.CalculoCusta1"."CDCALCULO" "CDCALCULO0"

          FROM "ECCPGRJEMITIDA" "x1"

          INNER JOIN "ECCPCALCCUSTA" "x.CalculoCusta1" ON ("x1"."CDFORO" = "x.CalculoCusta1"."CDFORO") AND ("x1"."CDCALCULO" = "x.CalculoCusta1"."CDCALCULO")

          INNER JOIN "ECCPTIPOCUSTA" "x.CalculoCusta.TipoCusta1" ON "x.CalculoCusta1"."CDTIPOCUSTA" = "x.CalculoCusta.TipoCusta1"."CDTIPOCUSTA"

          WHERE (((("x1"."CDFORO" IS NOT NULL OR "x1"."CDCALCULO" IS NOT NULL) AND ("x1"."CDFORO" IS NOT NULL OR "x1"."CDCALCULO" IS NOT NULL)) AND EXISTS (

              SELECT 1

              FROM "ECCPCALCCUSTAHIST" "a1"

              INNER JOIN "ECCPTIPORECOL" "a.TipoRecolhimento1" ON "a1"."CDTIPORECOL" = "a.TipoRecolhimento1"."CDTIPORECOL"

              WHERE ("a.TipoRecolhimento1"."FLDOCUMENTO" <> 'D') AND (("x.CalculoCusta1"."CDFORO" = "a1"."CDFORO") AND ("x.CalculoCusta1"."CDCALCULO" = "a1"."CDCALCULO")))) AND ("x1"."NUGRJEMITIDA" = :numeroGrjSemForo_0)) AND ("x1"."CDFORO" = :codigoForo_1)

      ) "t0" ON ("HistoricosCalculoCusta"."CDFORO" = "t0"."CDFORO0") AND ("HistoricosCalculoCusta"."CDCALCULO" = "t0"."CDCALCULO0")

      ORDER BY "t0"."CDFORO" NULLS FIRST, "t0"."CDCALCULO" NULLS FIRST, "t0"."NUGRJEMITIDA" NULLS FIRST, "t0"."CDFORO0" NULLS FIRST, "t0"."CDCALCULO0" NULLS FIRST

Best Answer

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited March 2019 Accepted Answer

    You can limit the length of your identifiers by setting the RelationalModelAnnotations.MaxIdentifierLength property. The documentation that is part of the EF Core beta has more info on how to use this property.

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited March 2019 Accepted Answer

    You can limit the length of your identifiers by setting the RelationalModelAnnotations.MaxIdentifierLength property. The documentation that is part of the EF Core beta has more info on how to use this property.

Sign In or Register to comment.