Search code examples
variablesoracle11gpackagestep-into

How to monitor type within oracle package


I'm working on a perviously developed website that uses oracle as the back end. I'm getting a ORA-06502: PL/SQL: numeric or value error and I'm trying to pinpoint the exact issue. The problem I have is some of the procedures are using for loops with type tables. In the specifications of the package it defines the type:

type recCol is record(
  ID          tblVars.ID%type,
  vName       tblVars.vName%type,
  vLabel      tblVars.vLabel%type,
  Year        tblFiles.Year%type,
  PrettyYear  tblFiles_vw.PrettyYear%type,
  TypeID      tblType.ID%type,
  CatID       tblCategory.ID%type,
  CatAID      tblCategory.ID%type,
  Cat         tblCategory.Name%type,
  CatA        tblCategory.Name%type,
  Type        tblType.Type%type,
  Source      tblSource.Source%type);

  type typCols is table of recCol index by pls_integer;

Within the package body the type is used for this variable
tabCols       typCol;

How can I check the contents of tabCols? I can't seem to pinpoint the exact cause of the error.

Any help would be appreciated.


Solution

  • You can use this query to check the details of the type .

    SQL> select * from all_type_attrs WHERE TYPE_NAME='TASK_OBJ';
    
    
    OWNER                          TYPE_NAME                      ATTR_NAME                      ATTR_TY ATTR_TYPE_OWNER                ATTR_TYPE_NAME                     LENGTH  PRECISION      SCALE CHARACTER_SET_NAME                              ATTR_NO INH C
    ------------------------------ ------------------------------ ------------------------------ ------- ------------------------------ ------------------------------ ---------- ---------- ---------- -------------------------------------------- ---------- --- -
    SCOTT                          TASK_OBJ                       TASK_NAME                                                     VARCHAR2                              100                       CHAR_CS                                       1 NO  B
    
    SQL> /