Question by adding the LOBs-ORA-06502: PL/SQL: digital error or value

Hello

I'm using Oracle 11 g.

I have a requirement in which I need to add LOBs and I must insert the LOB in a table column. I am facing problem when the data exceeds certain limits. My program works like the following:

(Please note that my program logic is given below, not the exact program)

DECLARE

final_html CLOB.
int_html CLOB.
v_str VARCHAR2 (32767).

i the number: = 0;

BEGIN


DBMS_LOB.CREATETEMPORARY (lob_loc = > int_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
DBMS_LOB.CREATETEMPORARY (lob_loc = > final_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
dbms_output. ENABLE (1000000);


FOR i 1,100 loop

v_str: = "< b >" |
"< style td =" "DRESSING: break-word" width = "50" > < font size = "2" > ' | "
I have | ' < / police > < table > ' |
"< /tr >";

DBMS_LOB. WriteAppend (lob_loc = > int_html, amount = > LENGTH (v_str), BUFFER = > v_str);


END LOOP;
dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));

dbms_output.put_line (' the int_html :'|| is int_html).

final_html: = "< html >" | int_html | "< / html > ';
dbms_output.put_line (' the final_html :'|| is final_html).



EXCEPTION
WHILE OTHERS THEN


dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
DBMS_LOB. CLOSE (int_html);
DBMS_LOB. CLOSE (final_html);
DBMS_LOB. FREETEMPORARY (int_html);
DBMS_LOB. FREETEMPORARY (final_html);

END;


When the loop is made of lesser value, say FOR example, the loop i IN 1.10, the program works very well, but when the closure is done for values more I'm ' - 6502-ORA-06502: PL/SQL: digital error or value ' error message.

Please help me solve this problem.

Thanking you in advance.


Kind regards
Sri

Can you please specify what environment you run this?

I modified your code as follows

The code executed successfully until the length has been<= 32767="" i.e="" (="" until="" for="" i="" in="">

In addition, you must use the function APPEND to concatenate variables clob.

Please check the maximum size by default for varchar2 or dbms_output in your server since you get the error for just the loop in the range (FOR i IN 1,100).

And Yes, Siva comments are valid.

DECLARE

final_html CLOB.
int_html CLOB.
v_str VARCHAR2 (32767).

i the number: = 0;

BEGIN

DBMS_LOB.CREATETEMPORARY (lob_loc-online int_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
DBMS_LOB.CREATETEMPORARY (lob_loc-online final_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
dbms_output. ENABLE (1000000);

FOR i 1.1092 loop

v_str: = '' ||
'' ||
I have | '' ||
'';

DBMS_LOB. WriteAppend (lob_loc-int_html, amount => (v_str), BUFFER LENGTH-online v_str online);

END LOOP;

dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
Start
dbms_output.put_line (' the int_html :'|| is int_html).
dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
exception when others then
dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
end;
/*
Start
final_html: = ''|| int_html | »';
dbms_output.put_line (' the final_html :'|| is final_html).
exception when others then
dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
end; */

EXCEPTION
WHILE OTHERS THEN

dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
DBMS_LOB. CLOSE (int_html);
DBMS_LOB. CLOSE (final_html);
DBMS_LOB. FREETEMPORARY (int_html);
DBMS_LOB. FREETEMPORARY (final_html);

END;

Published by: Gurnani houta July 29, 2011 03:11

Published by: Gurnani houta July 29, 2011 03:14

Tags: Database

Similar Questions

  • Validation of the APEX: ORA-06502: PL/SQL: digital error or value:

    Hello

    I need help for validation. The user set to ' field minutes'(besoin d'un nombre compris entre 0 et 59).

    My solution is to do two commits:

    1 - no number:
    Name: P1_MINUTES
    Type: Regular Expression
    Validation expression 1: P1_MINUTES
    ({Validation expression 2: ^ \d{1,5}(\.\d{1,2})? $

    2. more high level then 59:
    Name: P1_MINUTES
    Type: Function return Boolean
    1 validation expression:
    If: P10_TOT_MINUTEN < 60 then
    Returns true;
    on the other
    Returns false;
    end if;
    Validation expression 2: -.

    2 validation gives this error (for example a = m value):
    ORA-06502: PL/SQL: digital or value error: character number conversion error - the reason is clear m value is not numeric

    How this problem can be solved!

    Condition 2 validation by using a condition of PL/SQL Expression:

    regexp_like(:p1_minutes, '^\d{1,5}(\.\d{1,2})?$')
    
  • Process apex Pl/SQL error: ORA-06502: PL/SQL: digital error or value: specified incorrect LOB Locator

    Apex 4.2

    I searched through the forums of the research about this error, but I do not understand what to do from here. I am writing a process that sends an e-mail when a value of the claim is made (or on a button click). Procedure is as follows:

    DECLARE
       l_body        clob;
       l_body_html   clob;
       l_subject    varchar2(100);
    
    BEGIN
      
    l_body := empty_clob();
    l_body_html := empty_clob();
    
    
    IF V('REQUEST') in ('SAVE_ME') AND :P32_PARENT_UPDATED_FL IS NOT NULL THEN
       l_subject :=  'Survey Job Request Updated'||utl_tcp.crlf||utl_tcp.crlf;
       l_body := 'Update'||utl_tcp.crlf;
    
       l_body_html := '<html>
          <head>
             <style type = "text/css">
                 /* Can add style attributes later */
             </style>
          </head>
          <body>'||utl_tcp.crlf;
       l_body_html := l_body_html ||'Survey Job Request has been updated.<br /><br />'||utl_tcp.crlf;
       l_body_html := l_body_html ||'Title: '||utl_tcp.crlf;
       l_body_html := l_body_html ||:P32_TITLE||utl_tcp.crlf;
       l_body_html := l_body_html ||'<br />Request Category : '||utl_tcp.crlf;
       l_body_html := l_body_html ||:P32_REQUEST_CATEGORY||utl_tcp.crlf;
       l_body_html := l_body_html ||'<br />Update Date: '||utl_tcp.crlf;
       l_body_html := l_body_html ||:P32_UPDATE_DATE||utl_tcp.crlf;
       l_body_html := l_body_html ||'<br />Updated By: '||utl_tcp.crlf;
       l_body_html := l_body_html ||:P32_LAST_EDITED_BY_USERID||utl_tcp.crlf;
       l_body_html := l_body_html ||'</body></html>';
    
    
    
    
    
    END IF;
    
    :P32_CANCELLATION_REASON := l_body_html;
    
    apex_mail.send(
       p_to             =>  '[email protected]',
       p_from           =>  '[email protected]',
       p_body           =>  l_body_html,
       p_body_html      =>  l_body_html,
       p_subj           =>  l_subject);
    
    END;
    
    
    
    
    
    
    
    
    
    

    I added two lines to the code (lines 08 and 09) and when I run my program, I now get the error:

    • ORA-21560: 3 argument is null, invalid or out of range

    Without these two lines, I received the error:

    ORA-06502: PL/SQL: digital error or value: specified incorrect LOB Locator

    I'm not quite sure what is wrong or what I can change. There seems to be right, and in fact, it worked before. I have no idea why this error keeps popping up. Any help on that would be great. Thanks in advance.

    Hello

    NewApexCoder wrote:

    Hmmm... good point. I think that apex_mail.send must be called inside the IF block. But in the future, I added several conditional statements, won't I need to include the apex_mail.send function in each IF block? But at the same time, there is the case that if no conditional instructions are met? Tests, when none of the conditions are true (when I had a second IF block in the code), an email would not be defined, which is correct. Could that be causing a problem however. If the IF block is not filled could he always try to send an email about anything or the l_body_html and l_subject fields have in them the garbage that causing ORA error?

    If the call to the procedure of sending (it is a procedure, and not a function) many times is necessary or useful depends on exactly what you're trying to do.

    For example, you can write to Santa for

    • Submit a wish list
    • Change of address
    • Contradiction with your boss, who can you tell Santa you were mean

    or any combination of these grounds.  If you want to send a simple email whenever any of the conditions are met (and not send a when none are met), then you could do something like this:

    DECLARE

    need_to_send BOOLEAN: = FALSE;

    ...

    BEGIN

    ...

    IF wish_list IS NOT NULL

    THEN

    l_body: = l_body | ...

    need_to_send: = TRUE;

    END IF;

    IF old_addresss <> new_address

    THEN

    l_body: = l_body | ...

    need_to_send: = TRUE;

    END IF;

    IF boss_is_a_big_fat_liar

    THEN

    l_body: = l_body | ...

    need_to_send: = TRUE;

    END IF;

    IF need_to_send

    SO - It's the only call to send

    apex_mail. Send...

    In any case, the error message ' ORA-21560: argument 3 sucks...» "is pretty clear: If you have not given a value to everything you're passing as p_body, then you'd better call the procedure.

  • While the BLOB conversion of type CLOB error - ORA-06502: PL/SQL: digital error or value

    Passing data from attachment of DB (Blob data Type) after the CLOB data type conversion, giving the error "ORA-06502: PL/SQL: digital error or value" in the PL/SQL package. If the BLOB size 32K > it will give another error works great my procedure.

    For example, I enclose my code here.

    function get_base64 (p_blob_in in blob) return clob is

    CLOB v_clob;

    CLOB v_result;

    whole v_offset;

    v_chunk_size PLS_INTEGER: = 12288;

    v_buffer_varchar varchar2 (32767).

    v_buffer_raw raw (32767).

    Start

    fnd_file.put_line (fnd_file.log, 'here');

    If p_blob_in is null then

    Returns a null value.

    end if;

    DBMS_LOB.CREATETEMPORARY (v_clob, true);

    fnd_file.put_line (fnd_file.log, 'here1');

    v_offset: = 1;

    fnd_file.put_line (fnd_file.log, 'Loop value'-| ceil (DBMS_LOB.) GetLength (p_blob_in) / v_chunk_size));

    because me in 1... ceil (DBMS_LOB. GetLength (p_blob_in) / v_chunk_size) loop

    DBMS_LOB. Read (p_blob_in, v_chunk_size, v_offset, v_buffer_raw);

    v_buffer_raw: = utl_encode.base64_encode (v_buffer_raw);

    v_buffer_varchar: = utl_raw.cast_to_varchar2 (v_buffer_raw);

    DBMS_LOB. WriteAppend (v_clob, length (v_buffer_varchar), v_buffer_varchar);

    v_offset: = v_offset + v_chunk_size;

    end loop;

    fnd_file.put_line (fnd_file.log, 'Out of the loop');

    v_result: = v_clob;

    fnd_file.put_line (fnd_file.log, 'V_result length' - |) DBMS_LOB. GetLength (v_result));

    fnd_file.put_line (fnd_file.log, 'V_result' - | v_result);

    DBMS_LOB.freeTemporary (v_clob);

    Return v_result;

    exception

    while others then

    fnd_file.put_line (fnd_file.log, 'Error based on the encode_base64' - |) SQLERRM);

    Returns a null value.

    end;

    In my main program I call this function as below:

    Main proceedings...

    l_return_clob CLOB.

    Begin

    ....

    l_return_clob: = get_base64 (p_blob_in);

    -In returning it gives error - ORA-06502: PL/SQL: digital error or value

    end;

    Then, please mark the thread ANSWERED.

  • ORA-06502: PL/SQL: digital error or value

    Hello

    We have a package with a cursor that returns the session information:

    create or replace 
    PACKAGE BODY             "LOGIN_AUDIT" 
    ...
    ...
      CURSOR session_cur IS
        SELECT * FROM v$session WHERE audsid=USERENV('sessionid');
    
     session_rec session_cur%ROWTYPE;
    
    ...
    
    FUNCTION get_osuser
        RETURN VARCHAR2
      IS
      BEGIN
        RETURN session_rec.osuser;
      END;
    
    FUNCTION get_dbuser
        RETURN VARCHAR2
      IS
      BEGIN
        RETURN NVL(session_rec.username, 'ORACLE_SYS');
      END;
    
    ...
    

    The package compiled successfully and works ok out for a function that is the get_osuser. When you launch sqlplus, we get the following error:

    Select double LOGIN_audit.get_osuser;

    *

    ERROR on line 1:

    ORA-06502: PL/SQL: digital error or value

    ORA-06512: at "APPUSR. LOGIN_AUDIT', line 94

    ORA-06512: at "APPUSR. LOGIN_AUDIT', line 102

    The APPUSR has select priv on V$ SESSION and a select * from v$ session returns the session information. We can perform any other function since the package without any problem, for example:

    APPUSR@APPD > select double login_audit.get_dbuser;

    GET_DBUSER

    -------------------------------------------------------------

    APPUSR

    Can someone help us work on what happens please.

    PS Oracle: 11.2.0.3, OS Windows 2008 server.

    Thank you

    Really I have not aside, this and raise the question?

    Why you write all this code?

    wouldn't the following very good enough?

    1. FUNCTION get_osuser RETURN VARCHAR2;                    Use sys_context ('USERENV', 'OS_USER')
    2. FUNCTION get_dbuser RETURN VARCHAR2;                    Use sys_context ('USERENV', 'SESSION_USER')
    3. FUNCTION get_client_info RETURN VARCHAR2;                   Use sys_context ('USERENV', 'CLIENT_INFO')
    4. FUNCTION get_module_info RETURN VARCHAR2;               Use sys_context ('USERENV', 'MODULE')
    5. FUNCTION get_action_info RETURN VARCHAR2;                  Use sys_context ('USERENV', 'ACTION')

    Just do not know, I see the advantage of messing around with this slider and have to fight with the updating of information and others.

    This would totally work around the error you get and probably accelerate - and make it easier to maintain.

    ??

    Unless there is some additional requirements, that I'm missing

  • Error processing request. ORA-06502: PL/SQL: digital error or value OK

    Hello

    I want to open a session in an APEX application using the IE 8 browser, but I can't because this error:

    https://naa-vm02.us.oracle.com:7510/i/error.gifErrorError processing request.
    ORA-06502: PL/SQL: digital error or value
    Ok

    I can run this app with Chrome or Mozilla, but I need to open it with IE.

    Can you please tell me how should I solve this problem?

    Thank you

    It is a problem with your version of APEX that you use... There was a patch released about 6 months ago... or you can just upgrade to the latest version. I also had this problem, and there are several similar topics in this forum about the exact problem and at least the a precise details on the patch/fix.

  • UTL_SMTP. Data ORA-06502: PL/SQL: digital error or value

    Hello

    I use utl_smtp to send an HTML email, I'm passing in a clob to utl_smtp.data (), works very well for some emails small relativley is no bigger nut, which return the following error

    ORA-06502: PL/SQL: digital error or value

    Does anyone know what the limitation is the size if the parameter of body to utl_smtp.data (), and is there another way to send large mails?

    Thank you...

    refer to this

    http://www.Oracle-base.com/articles/Misc/email-from-Oracle-plsql.php

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:3366784949717501:P11_QUESTION_ID:1739411218448

  • ORA-06502: PL/SQL: digital error or value: number too high accuracy

    Hi all
    Sorry I can't speak English very well
    ========
    IM creating a function in the hr schema
    I need to calculate a tax
    syntax of the function is

    CREATE OR REPLACE THE TAX FUNCTION
    (F_TAX EMPLOYEES % OF SALARY TYPE)
    RETURN NUMBER IS
    V_SAL EMPLOYEES. % SALARY TYPE.

    BEGIN
    SELECT salary * 12
    IN v_sal
    Employees
    WHERE EMPLOYEE_ID = F_TAX;
    IF V_SAL > = 40000 THEN
    V_SAL: = V_SAL / 0,20;
    ELSIF V_SAL > = 30000 THEN
    V_SAL: = V_SAL / 0.15;
    END IF;
    RETURN V_SAL;
    TAX END;
    ==================
    When I select a tax I have this problem
    SELECT (EMPLOYEE_ID) TAX
    EMPLOYEES

    It comes
    SELECT (EMPLOYEE_ID) TAX
    *
    ERROR on line 1:
    ORA-06502: PL/SQL: digital error or value: number too high accuracy
    ORA-06512: at "HR. The TAX", line 16

    V_SAL is declared as HR. EMPLOYEES. % OF SALARY TYPE. If you look at the definition of time. The table EMPLOYEES, the SALARY column is a NUMBER (8,2). This means that it can handle numbers up to $999,999.99 (8 total digits with 2 decimal places).

    Your IF statement is dividing the salary by 0.20, which is equivalent to multiplying by 5 or dividing by 0.15, which is multiplied by 6.67. In reality, at least a salary is high enough now that when you multiply by 5 or 6.67 it exceeds the limit of $999,999.99 (especially when you already multiplied by 12 SALARY column in your SELECT statement).

    -If your intention is to return in numbers that exceed the limits of the SALARY column in human resources. EMPLOYEES, you will need to declare V_SAL differently. You can declare V_SAL as a NUMBER (11.2), for example, given that any number that you store in a NUMBER (8.2), multiplied by 60, which can be represented in a NUMBER (11.2).
    -If your intention is to return the numbers that fall within the limits of the SALARY column in human resources. USED, I suspect that the algorithm that you implemented is incorrect. Perhaps, for example, you would divide by 1.2 or 1.15 as a kind of tax accounting?

    Justin

  • Lexical parameter error: ORA-06502: PL/SQL: digital error or value

    Hello

    I am facing a problem with my lexical parameter. I have a requirement where I have to pass a string to the db column. I think that I am facing problem with quotes. Please find the sample code below:

    : lp_trans_type: = "" AND (RSV.transaction_type <>"F" OR RSV.transaction_type is NULL);"

    The report compiles suceccfully but when run from window SRS that generates an error

    REP-1401: "afterpform": PL/SQL unrecoverable error occurred.
    ORA-06502: PL/SQL: digital error or value

    Please help me how to set up the string within a string. Or please suggest a possible solution.

    Thanks in advace.

    Kind regards
    Prakash

    Check the data type and length of lp_trans_type.

    This is not the error, but will not work your query:

    RSV.transaction_type "F"

    You forgot the =.

    Published by: InoL on July 20, 2010 12:57

  • product loop "ORA-06502: PL/SQL: digital error or value."

    Why I get the error message ' ORA-06502: PL/SQL: digital error or value "to the code below.
    create table bc (
      a number, 
      b varchar2(10)
    );
    
    
    declare
      type t_bc_a is table of bc.a%type;
      type t_bc_b is table of bc.b%type;
      l_bc_a t_bc_a;
      l_bc_b t_bc_b;
    begin
      dbms_output.put_line('1');
      select a, b bulk collect into l_bc_a, l_bc_b from bc;
       dbms_output.put_line('2');
       if l_bc_a is null then
         dbms_output.put_line('2.1'); 
       else
         dbms_output.put_line('2.2, l_bc_a.count=' || l_bc_a.count); 
         
       end if;
      for i in l_bc_a.first .. l_bc_a.last loop
       dbms_output.put_line('3');
        dbms_output.put_line(l_bc_a(i) || ', ' || l_bc_b(i));
      end loop;
    end;
    
    /*
    1
    2
    2.2, l_bc_a.count=0
    ORA-06502: PL/SQL: numeric or value error
    */
    "Bc" table is empty and I expect loop never to do any cycle a step, but I get the error. Why the error is there.

    Hello!

      for i in l_bc_a.first .. l_bc_a.last loop
       dbms_output.put_line('3');
        dbms_output.put_line(l_bc_a(i) || ', ' || l_bc_b(i));
      end loop;
    

    In your case, l_bc_a.first is null and l_bc_a.last is the same

    in the case

    because me to null... loop of null

    such an error is returned

    T

  • ORA-06502: PL/SQL: digital error or value: hex to raw conversion error

    Hello gurus,

    I'm trying to encrypt the dbms_obfuscation_toolkit method

    CREATE or REPLACE function Cryption2 (long input_string) gross yield
    IS
    -input_string VARCHAR2 (16): = "tigertigertigert";
    raw message (32767).
    raw_input RAW (128);
    long key_string (20000): = "scottsco";
    raw_key RAW (128);
    encrypted_raw RAW (2048);
    long encrypted_string (20000);
    decrypted_raw RAW (2048);
    long decrypted_string (20000);
    error_in_input_buffer_length EXCEPTION;
    PRAGMA EXCEPTION_INIT(error_in_input_buffer_length,-28232);
    INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2 (100): =.
    ' * NOT A MULTIPLE OF 8 BYTES IN THE INPUT BUFFER AND *';
    BEGIN
    message: = UTL_RAW. CAST_TO_RAW (Convert (input_string, 'AL32UTF8', 'US7ASCII'));
    message: = UTL_RAW. CAST_TO_RAW (Convert (key_string, 'AL32UTF8', 'US7ASCII'));
    dbms_output.put_line (' > = BEGIN TEST =');
    dbms_output.put_line (' > enter string: ' |)
    input_string);
    START < ignore this, typo in the Oracle documentation
    dbms_obfuscation_toolkit. Decrypt)
    input_string = > input_string,.
    key_string = > key_string,
    encrypted_string = > encrypted_string);
    dbms_output.put_line (' > Encrypted string: ' |)
    encrypted_string);
    -Add as shown DESDecrypt, gross change in chaine_cle
    -END IF;
    Return encrypted_string;
    EXCEPTION
    WHEN error_in_input_buffer_length THEN
    dbms_output.put_line (' > ' |) INPUT_BUFFER_LENGTH_ERR_MSG);
    END;
    /

    But I get the following error

    When I try:-select cryption2 ('abcdefgh') of double;

    ORA-06502: PL/SQL: digital error or value: hex to raw conversion error
    ORA-06512: at the "', line 31" "

    Thanks and greetings
    Pratik Lacoste
    DBA Oracle Jr

    Published by: Pratik.L on December 13, 2009 21:58

    Hey Pratik,

    You seem to be under pressure. The code that you pasted last a lot of stupid mistakes.
    In both the features that you use to encrypt or decrypt that you must follow the data type, the procedure is overloaded.

    Source: http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10802/d_obtool.htm

    The previous post for this was varchar2 usinf encrpt and decrypt.

    The code below, which is your code, I'm taking the value as varchar2 and return varchar2 but internally
    that you posted, I'm going in raw data to her encrypt and decrypt procedures.

    SQL> CREATE OR REPLACE Function try_Cryptit (input long) return clob
      2   IS
      3
      4  key_string RAW(2000);
      5  crypt_dycp_raw RAW(2000);
      6  crypt_encp_raw RAW(2000);
      7  crypt_str clob;
      8  key_raw RAW(2000) := UTL_RAW.CAST_TO_RAW('frankzap');
      9  input_raw RAW(2000):=UTL_RAW.CAST_TO_RAW(input);
     10   message varchar2(2000);
     11
     12  BEGIN
     13   dbms_obfuscation_toolkit.DESEncrypt(
     14   input => input_raw,
     15   KEY => key_raw,
     16   encrypted_data => crypt_encp_raw);
     17
     18   -- Decrypt the string --
     19
     20   dbms_obfuscation_toolkit.DESDecrypt(
     21   input => crypt_encp_raw,
     22   KEY => key_raw,
     23   decrypted_data => crypt_dycp_raw);
     24
     25   crypt_str := utl_raw.cast_to_varchar2(input_raw);
     26   return crypt_str;
     27   END;
     28
     29  /
    
    Function created.
    
    SQL> select try_Cryptit ('abcdefgh') from dual;
    
    TRY_CRYPTIT('ABCDEFGH')
    --------------------------------------------------------------------------
    abcdefgh
    

    Follow be varchar2 or raw for this purpose.

    Twinkle

  • ORA-06502: PL/SQL: digital error or value, ORA-06512: online

    I'm trying to do something like that. The application works well and returns a few rows when run independently. But the script gives error:
    ORA-06502: PL/SQL: digital error or value
    ORA-06512: at line 108

    DECLARE
    QCURSOR SYS_REFCURSOR;
    QUERYCONTEXT DBMS_XMLGEN. CTXHANDLE;
    RESULT CLOB.
    RXML XMLType.
    BEGIN
    OPEN QCURSOR TO SELECT
    SOMECOLUMN1 "Label1"
    .
    .
    .
    .

    FROM SOMETABLE;


    queryContext: = DBMS_XMLGEN.newContext (qcursor);

    DBMS_XMLGEN.setRowSetTag (queryContext, 'Message');
    DBMS_XMLGEN.setRowTag (queryContext, 'Record');
    DBMS_XMLGEN.setNullHandling (queryContext DBMS_XMLGEN. EMPTY_TAG);

    -To get the result
    result: = DBMS_XMLGEN.getXML (queryContext);

    -Narrow context
    DBMS_XMLGEN.closeContext (queryContext);

    NARROW Qcursor;

    Train IS NULL THEN
    DBMS_OUTPUT. PUT_LINE ('(NULL)');
    ON THE OTHER
    DBMS_OUTPUT. Put_line (result); -Line 108
    END IF;
    END;

    Could not understand what the problem is? Any ideas?

    Omer

    The result is CLOB, I remember that they must be treated differently (not via dbms_output.put_line).

    Something like:

    dbms_output.put_line (DBMS_LOB. GetLength (l_xmlclob));
    -display the content of CLOB
    LOOP
    l_loc: = dbms_lob.instr (l_xmlclob, Chr (10), l_anc);
    l_text: = dbms_lob.substr (l_xmlclob, l_loc - l_anc, l_anc);
    l_anc: = l_loc + 1;
    dbms_output.put_line (l_text);
    WHEN OUTPUT l_loc = 0;
    END LOOP;

  • ORA-06502: PL/SQL: digital error or value: the value of key NULL index table?

    Hello

    Can someone let me know what is the problem the code below and how can we avoid this? I get the error message as below

    ORA-06502: PL/SQL: digital or value error: NULL index key value table

                        v_while_loop := 1;
                        v_delete_char_id := v_tabtype_result_values.FIRST;
                        WHILE v_while_loop <> v_tabtype_result_values.COUNT 
                        LOOP
                            IF check_duplicate_nc_data (v_result_view, 
                                                        v_tabtype_result_values(v_delete_char_id).value,
                                                        v_collection_id,
                                                        v_occurrence,
                                                        v_plan_id,
                                                        v_delete_char_id
                                                        )
                            THEN
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
                                v_tabtype_result_values.DELETE(v_delete_char_id);
                            ELSE
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
                                                        ||v_tabtype_result_values(v_delete_char_id).value||','
                                                        ||v_tabtype_result_values(v_delete_char_id).validation_flag
                                                        );
                            END IF;
    
                            v_while_loop := v_while_loop + 1;
                            v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
                        END LOOP;

    Change:

    WHILE v_while_loop <> v_tabtype_result_values.COUNT 
    

    TO

    WHILE v_while_loop <= v_tabtype_result_values.LAST
    

    SY.

  • LONG LONG-&gt; ORA-06502: PL/SQL: digital error or value

    SQL>desc all_views
     Name                                      Null?    Typ
     ----------------------------------------- -------- ----------------------------
     OWNER                                     NOT NULL VARCHAR2(30)
     VIEW_NAME                                 NOT NULL VARCHAR2(30)
     TEXT_LENGTH                                        NUMBER
     TEXT                                               LONG
     TYPE_TEXT_LENGTH                                   NUMBER
     TYPE_TEXT                                          VARCHAR2(4000)
     OID_TEXT_LENGTH                                    NUMBER
     OID_TEXT                                           VARCHAR2(4000)
     VIEW_TYPE_OWNER                                    VARCHAR2(30)
     VIEW_TYPE                                          VARCHAR2(30)
     SUPERVIEW_NAME                                     VARCHAR2(30)
    
    SQL>
    SQL>declare 
      2      txt_view  LONG;
      3   begin
      4      SELECT 
      5      TEXT INTO txt_view
      6      from all_views
      7      where
      8      VIEW_NAME = 'V_KN_SKA';
      9   end;
     10   /
    declare
    *
    FEHLER in Zeile 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: in Zeile 4
    
    SQL>select TEXT_LENGTH
      2  from all_views
      3  where
      4  VIEW_NAME = 'V_KN_SKA';
    
    TEXT_LENGTH
    -----------
          53816
    When I put the TEXT in ULTRA EDIT, I get a 54676 byte value.

    'TEXT' of all_views column is of type LONG, and the variable "txt_view" is too LONG. Why become a digital error or value?

    just a number...

    Oracle advises against the use of LONG columns, they advice to use instead the LOB (CLOB or BLOB)
    For a long TIME are a pain in one... to work with, as you have found by yourself

    Why do you want to use LONG and not of CLOB?

  • Workflow PO error "ORA-06502: PL/SQL: digital error or value."

    Hi guys,.


    Column MAIL_STATUS of the WF_NOTIFICATIONS ERROR value



    SQL > select ERROR_MESSAGE in wf_item_activity_statuses_v WHERE NOTIFICATION_ID = 1320203



    ERROR_MESSAGE

    --------------------------------------------------------------------------------

    [WF_ERROR] ERROR_MESSAGE = 3835: error '-6502 - ORA-06502: PL/SQL: numeric or earned

    e error: form of associative array is not compatible with enco session settings

    untered during execution of the function Generate ' WF_XML. Generate 'event' oracl

    e.apps.WF.notification.Send'. ERROR_STACK =

    PO_REQAPPROVAL_LAUNCH. POREQ_SELECTOR (POAPPRV, TEST_CTX, 10150-25246)

    Wf_Engine_Util.Function_Call (PO_REQAPPROVAL_LAUNCH. POREQ_SELECTOR, POAPPRV, 1015

    0-25246, TEST_CTX)

    Wf_Engine_Util.Execute_Selector_Function (POAPPRV, TEST_CTX, 10150-25246)

    Wf_Engine_Util.Function_Call (PO_REQAPPROVAL_LAUNCH. POREQ_SELECTOR, POAPPRV, 1015

    0-25246, TEST_CTX)

    Wf_Engine_Util.Execute_Selector_Function (POAPPRV, TEST_CTX, 10150-25246)

    Wf_Engine.CB (TESTCTX, POAPPRV:10150 - 25246:208270, :::))

    Wf_Engine.oldCB (TESTCTX, POAPPRV:10150 - 25246:208270, :::))

    WF_MAIL. SetContext (1320203)

    WF_XML. GenerateDoc (oracle.apps.wf.notification.send, 1320203)

    WF_XML. Generate (oracle.apps.wf.notification.send, 1320203)

    WF_XML. Generate (oracle.apps.wf.notification.send, 1320203)

    Wf_Event.setMessage (oracle.apps.wf.notification.send, 1320203, WF_XML.) Generate)

    Wf_Event.dispatch_internal)

    1 selected line.





    OS: RHEL5.7

    Database: 10.2.0.3

    Applications: R12.0.4

    Please help me to solve this error.

    Salvation;

    Please see the bulletin:

    Approval Confirmation e-mail is not received by trainer - ERROR_MESSAGE = 3835 ORA-20001 ORA-6502 [ID 465146.1]

    Respect of

    HELIOS

Maybe you are looking for