ORACLE-SQL-ORA-22814-Attribut oder-element einen Wert größer als angegeben Typ

Ich rufe eine Funktion zurückgibt, die eine Art von Tabelle.

Meine Funktion erhält eine variable vom Typ varchar. Weil ich wieder ein Typ, den ich ich hatte, um cast und multiset...

Meiner Probleme ist, dass, die wählen, in meinem multiset führt ohne problem außerhalb der Funktion, aber wenn ich Sie ausführen, meine Funktion gibt mir ORA-22814-Attribut oder-element einen Wert größer als angegeben Typ Fehler.
HINWEIS: ich immer führen Sie das Skript mit dem gleichen Wert der Variablen

Typ OBJEKT:

create or replace
TYPE Z_PEDIDO_SeB IS OBJECT(
Contrato varchar2(4000 BYTE),
DataObjectivo date,
DataObjectivoSpecified date,
Descricao varchar2(500 BYTE),
DireccaoRequerente varchar2(50 BYTE),
Empresa varchar2(50 BYTE),
Estado varchar2(50 BYTE),
GestorDDS varchar2(100 BYTE),
GestorEncomenda varchar2(30 BYTE),
Referencia varchar2(50 BYTE),
Link varchar2(500 BYTE),
ObsComite varchar2(4000 BYTE),
OutrosFornecedores varchar2(4000 BYTE),
OutrosSistAfectados varchar2(4000 BYTE),
PrincipalSistAfectado varchar2(4000 BYTE),
Prioridade varchar2(50 BYTE),
Rede varchar2(50 BYTE),
Requerente varchar2(100 BYTE),
TestesAceitacao varchar2(10 BYTE),
proj_id varchar2(50 BYTE));

Typ TABELLE:

create or replace
TYPE Z_TABLE_PEDIDO_SeB IS TABLE OF Z_PEDIDO_SeB;

FUNKTION:

create or replace
function Z_GetDadosCreateUpdate_SEB(
    proj_id in varchar2
)
return Z_TABLE_PEDIDO_SeB as
  t_dados   Z_TABLE_PEDIDO_SeB;
begin
  select 
  cast(
  multiset(
--STARTS HERE WHAT I RUN WITHOUT PROBLEM OUTSIDE THE FUNCTION
  select 
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'contrato'
) Contrato,
NVL(SCHEDULE_FINISH,ACTUAL_FINISH) DataObjectivo,
NVL(SCHEDULE_FINISH,ACTUAL_FINISH) DataObjectivoSpecified,
pedidos.description as Descricao,
costum.direcaorequerente DireccaoRequerente,
costum.empresa Empresa,
estado.description Estado,
costum.gestordds GestorDDS,
(select recursos.description
from structure recursos,
resources,
workflow,
wf_team
where recursos.structure_code = resources.resource_code
and workflow.planning_code = projectos.structure_code
and wf_team.workflow_id = workflow.workflow_id
and wf_team.lifecycle_role_code = '868'
and wf_team.user_name = resources.LOGON_ID
and rownum = 1
) GestorEncomenda,
pedidos.structure_code ID,
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'urlcadernoreq'
) Link,
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'observacoescomite'
) ObsComite,
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'outrosfornecedores'
) OutrosFornecedores,
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'outrossistemas'
) OutrosSistAfectados,
(SELECT line_text
from long_text 
where key2 = proj_id and key1 = 'principalsistema'
) PrincipalSistAfectado,
costum.prioridade Prioridade,
(SELECT rede.description
from structure rede, planning_entity proj
where proj.code88 = rede.structure_code
and proj.planning_code = proj_id
) Rede,
costum.requerente Requerente,
(SELECT rede.description
from structure rede, planning_entity proj
where proj.code89 = rede.structure_code
and proj.planning_code = proj_id
) TestesAceitacao,
projectos. structure_code proj_id
from structure projectos,
planning_entity,
structure pedidos,
structure estado,
custom_data costum
where projectos.structure_code = planning_entity.planning_code
and planning_entity.planning_code = planning_entity.ppl_code
and pedidos.structure_code = planning_entity.code31
and estado.structure_code = planning_entity.code20
and projectos.structure_code = proj_id
and costum.planning_code = proj_id
-- HERE ENDS WHAT I RUN OUTSIDE THE FUNCTION WITHOUT A PROBLEM
    ) 
      as Z_TABLE_PEDIDO_SeB)
    into
      t_dados
    from 
      dual;

  return t_dados;

end Z_GetDadosCreateUpdate_SEB;

Was ich ausführen:

SELECT * FROM table (PVDEV.Z_GetDadosCreateUpdate_SEB('184765'));

Fehler, die ich bekam:

ORA-22814: valor do atributo ou elemento é superior ao especificado no tipo
ORA-06512: na "PVDEV.Z_GETDADOSCREATEUPDATE_SEB", linha 7
22814. 00000 -  "attribute or element value is larger than specified in type"
*Cause:    Value provided for the object type attribute or collection element
       exceeded the size specified in the type declaration.
*Action:   Choose another value and retry the operation.

HINWEIS: wenn ich versuche 18476 statt 184765 läuft es mit kein problem. So? wie habe ich solche Beschränkung? Wo?

HINWEIS: Jetzt zeige ich den Fehler, die echte, ich bin wirklich sorry für die Fehler

Ich würde wirklich zu schätzen jede Antwort, wie andere Menschen auf Arbeit warten, für meinen Teil :S. Trotzdem danke im Voraus für jede information.

  • Haben Sie versucht, den Aufruf der Funktion nur als Funktion, ohne die select-Anweisung? Macht es richtig, die eine Tabelle zurückgeben, wie in DECLARE l_table Z_TABLE_PEDIDO_SeB; BEGIN l_table := PVDEV.Z_GetDadosCreateUpdate_SEB('184765'); end; ?
  • hol..wenn ich versuche zum ausführen des Codes bekomme ich den gleichen Fehler. Etwas ist sehr falsch mit der Größe meiner variable
InformationsquelleAutor FEST | 2012-09-05
Schreibe einen Kommentar