title: How to display the datatype of a variable in pl-sql
body: <p>I have a field "DIVISIONS" which has pipe (|) separated NUMBERs. I split the pipe separated values using following cursor in DECLARE section as below. I join it with a table because I need to obtain some other field from the table based on each value I split and add those values. The field in table is NUMBER(38).</p>
  
  <pre><code>FUNCTION foo (divisions IN VARCHAR2)
  RETURN NUMBER
  IS
        CURSOR splitDiv
        IS
          SELECT ud.* FROM (
            SELECT REGEXP_SUBSTR(divisions, '[^|]+', 1, ROWNUM) AS division
            FROM DUAL
            CONNECT BY LEVEL &lt;= LENGTH (REGEXP_REPLACE(divisions, '[^|]+'))  + 1
            ) d
          JOIN ud
          ON NVL(TO_NUMBER(d.division),0) = NVL(TO_NUMBER(ud.udValue),0);
  
    divStatusVar NUMBER(38) := 0;
  
  BEGIN
  
    FOR d IN splitDiv
    LOOP
      divStatusVar := divStatusVar + TO_NUMBER(d.status);
    END LOOP;
  
    RETURN divStatusVar ;
  
  EXCEPTION
    WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Code : ' || SQLCODE || ' Error : ' || SQLERRM);
      RETURN divStatusVar ;
  END foo;
  </code></pre>
  
  <p>This is how I call the function:</p>
  
  <pre><code>DECLARE
  ...
  status NUMBER(38) := 0;
  ...
  BEGIN
  ...
  status := foo('1234|6789');
  ...
  END;
  </code></pre>
  
  <p>When I execute the code above, I get following error:</p>
  
  <pre><code>ORA-01722: invalid number ORA-01403: no data found
  </code></pre>
  
  <p>I am clueless as to why this error is thrown. I want to see the datatype of "d.status". I have access to the database and the table UD, and the datatype of this field is NUMBER(38), but I am not sure if it's still the same after obtaining the rows in Cursor.</p>
  
  <p>Is there any way I can print the datatype of this field/variable?
  Or is there anything else that I am missing here?
  Any pointers will be of great help.</p>