Getting Ora-06502: PL/SQL of Numeric or value error.

Hello

I m getting the following error when a calculation for form fields.

""Server Ajax Call returned error Ora-06502: PL/SQL digital error or value ".

I m using the dynamic action to calculate my value fields display. Here is the code of my DA.

(Required value) event: change

Selection type (required): product (s)

Article (s) (required): P141_PROP_COST, P141_DOWNPAY_AMT, P141_PREM_PERC, P141_DOWNPAY_PERC, P141_PREM_AMT



Begin

: P141_TOTAL_SELL_PRICE: =: P141_DOWNPAY_AMT +: P141_PREM_AMT;

: P141_COMM_AMT: =: P141_TOTAL_SELL_PRICE*.02;

: P141_TOTAL_SELL_PRICE_FEE: =: P141_TOTAL_SELL_PRICE +: P141_TRANSFER_COST +: P141_COMM_AMt;

: P141_INST_REM_AMT: =: P141_PROP_COST-: P141_DOWNPAY_AMT;

End;

Page point to presented: P141_PROP_COST, P141_DOWNPAY_AMT, P141_PREM_AMT, P141_TRANSFER_COST

Return point page: P141_TOTAL_SELL_PRICE, P141_COMM_AMT, P141_TOTAL_SELL_PRICE_FEE, P141_INST_REM_AMT

I m using another DA for the calculation and validation of my form fields rest. Here is the code:

{$("#P141_DOWNPAY_PERC").change (function ()}

var x = ($("#P141_DOWNPAY_PERC").val () / 100) * $("#P141_PROP_COST").val ();

$("#P141_DOWNPAY_AMT").val (x);

});

{$("#P141_DOWNPAY_AMT").change (function ()}

If ($("#P141_DOWNPAY_AMT").val () > $("#P141_PROP_COST").val ())

{

Alert ("section may be no greater than the basic price");

}

on the other

{var y = ($("#P141_DOWNPAY_AMT").val () / ($("#P141_PROP_COST").val ())) * 100;}

y = Math.Round (y);

$("#P141_DOWNPAY_PERC").val (y) ;}

});

{$("#P141_PREM_PERC").change (function ()}

var x = ($("#P141_PREM_PERC").val () / 100) * $("#P141_PROP_COST").val ();

$("#P141_PREM_AMT").val (x);

});

{$("#P141_PREM_AMT").change (function ()}

If ($("#P141_PREM_AMT").val () > $("#P141_PROP_COST").val ())

{

Alert ("section may be no greater than the basic price");

}

on the other

{var z = ($("#P141_PREM_AMT").val () / ($("#P141_PROP_COST").val ())) * 100;}

z = Math.Round (z);

$("#P141_PREM_PERC").val (z) ;}

});

Any help.

Concerning

Pa

'Problems of implicit conversion' comes to mind when I see this:

: P141_TOTAL_SELL_PRICE: =: P141_DOWNPAY_AMT +: P141_PREM_AMT;

This is similar to the problems I've seen when using the default formats for the Date Picker Item Types.

I will add in some APEX_DEBUG. MESSAGE() lines to check what are the string values.

(remember, all bind variables are of type VARCHAR2)

You should maybe explicitly to convert strings to numbers using TO_NUMBER() and include the appropriate format.

(a bit like you have to do with the conversion of strings to dates.)

My $0.02 worth

MK

Tags: Database

Similar Questions

  • ORA-06502: PL / SQL: numeric or value error: character string buffer too small

    Dear friends,

    We have a package customized for FTP PLSQL.
    I get ORA-06502: PL/SQL: digital or value error: character string buffer too small when the FTP service running.
    The FTP function call the HOST function that is in fact to launch the above mentioned error.
    Here is the code for FTP and HOST functions.
    FUNCTION HOST(text_in    IN VARCHAR2,
               result_out IN OUT VARCHAR2) RETURN BOOLEAN IS
    ret boolean;
    drun boolean;
    hid number;
    BEGIN
       dbms_output.put_line('host1 begin');
       ret := HOST(text_in,result_out,hid,drun,1);
       if not drun then
         dbms_output.put_line('not derun');
          return false;
       end if;
         dbms_output.put_line('after if');
       return ret;
    END HOST;
    FUNCTION GET_ENV(env IN VARCHAR2) RETURN VARCHAR2 IS
     res boolean;
     out varchar2(256);
    BEGIN
      res := HOST('echo '||env,out);
      return out;
    END GET_ENV;
    FUNCTION HOST(text_in      IN VARCHAR2,
              result_out IN OUT VARCHAR2,
              hostid     IN OUT NUMBER ,
              demrunning IN OUT boolean,
              maxlines   IN NUMBER DEFAULT NULL) RETURN BOOLEAN IS
      tempid      number;
      tempstat      varchar2(10);
      n           number;
      m           number;
      retry      number;
      mult           number;
      timestamp_date  date;
      lv_result_out varchar2(200);
    BEGIN
      --result_out := NULL; --fcxh76
      demrunning := true;
      dbms_output.put_line('host2 begin');
      select XXAR_SHELL_CMD_S.nextval
      into  tempid from dual;
      hostid := tempid;
    
      dbms_pipe.pack_message(tempid);
      n := dbms_pipe.send_message('CMD');
    
      dbms_pipe.pack_message(abs(maxlines));
      dbms_pipe.pack_message(rtrim(text_in));
      n := dbms_pipe.send_message ('CMD'||rtrim(to_char(tempid)),0);
    
      m := dbms_pipe.receive_message('CMDSTAT'||rtrim(to_char(tempid)),5);
      if m = 1 then
          demrunning := false;
          dbms_output.put_line('m=1');
          result_out := 'ERROR : GLCC0005 presumed not running';
          dbms_output.put_line('result_out - '||result_out);
          return FALSE;
      elsif m = 0 then
         dbms_pipe.unpack_message(tempstat);
      end if;
    
      if tempstat = 'ERROR' then
         dbms_output.put_line('tempstat = ERROR');
         result_out := NULL;
         dbms_output.put_line('after result out');
         return FALSE;
      end if;
    <<CHECK_AGAIN>>
         m := dbms_pipe.receive_message('RSLT'||rtrim(to_char(tempid)),0);
    
    if m <> 0 then
        goto CHECK_AGAIN;
    end if;
    
         if m = 0 then
                dbms_pipe.unpack_message(result_out);
                dbms_pipe.purge('RSLT'||rtrim(to_char(tempid)));
                return TRUE;
         else
             result_out := 'ERROR : Call to GLCC0006 failed';
             return FALSE;
         end if;
    END HOST;
    FUNCTION FTP (program_name in VARCHAR2,
               source_file in VARCHAR2,
               dest_file   in VARCHAR2 default NULL) RETURN BOOLEAN
    AS
    fd               utl_file.file_type;
    res            boolean;
    res1           boolean;
    out            varchar2(256);
    out1           varchar2(256);
    ftp_dnsname      varchar2(50);
    ftp_user         varchar2(50);
    ftp_pass         varchar2(50);
    ftp_pre_opt      varchar2(150);
    ftp_post_opt     varchar2(150);
    ftp_override     varchar2(150);
    destination_file varchar2(50);
    ftp_command      varchar2(2000);
    ftp_main         varchar2(2000);
    proc_id           varchar2(10);
    fderr             varchar2(100);
    rec           varchar2(1024);
    temp_buf      varchar2(100);
    base_source       varchar2(100);
    log_dir              varchar2(100) := get_env('$APPLCSF')||'/log';
    fndc_logfile_dir varchar2(100) := 'FNDC_LOGFILE_DIR';
    i            number ;
    ftp_tried        boolean;
    begin
     ftp_tried := false;
     dbms_output.put_line('begin');
    for ftp_rec in ( select  attribute1,
                       attribute2,
                       attribute3,
                       attribute4,
                       nvl(attribute5,' ') attribute5,
                       nvl(attribute6,' ') attribute6,
                       nvl(rtrim(attribute7),'put') attribute7
              from fnd_flex_values
              where  flex_value_set_id in
              (select flex_value_set_id
               from fnd_flex_value_sets
               where flex_value_set_name = 'CPC_FTPS'
              )
              and flex_value like program_name
              )
         LOOP
                 dbms_output.put_line('Looping');
               ftp_tried := true;
              ftp_dnsname      := ftp_rec.attribute1;
              ftp_user         := ftp_rec.attribute2;
              ftp_pass         := ftp_rec.attribute3;
              destination_file := ftp_rec.attribute4;
              if dest_file is not null then
                 destination_file := dest_file;
                    end if;
    
                                   if destination_file is null then
                    destination_file := base_name(source_file);
                end if;
                ftp_pre_opt      := ftp_rec.attribute5;
              ftp_post_opt     := ftp_rec.attribute6;
              ftp_override     := lower(ftp_rec.attribute7);
              dbms_output.put_line('host');
    
              res := HOST('echo $$',proc_id);
              dbms_output.put_line('proc_id - '||proc_id);
         dbms_output.put_line('after host');
         base_source := rtrim(base_name(source_file));
           dbms_output.put_line('host 1');
           res := HOST('>  '||log_dir||'/ftpcmd.'||proc_id ||
              ' ; chmod 777 '||log_dir||'/ftpcmd.'||proc_id,out1);
           dbms_output.put_line('host 2');
           res := HOST('>  '||log_dir||'/ftpmain.'||proc_id ||
              ' ; chmod 777 '||log_dir||'/ftpmain.'||proc_id,out1);
           dbms_output.put_line('host 3');
           res := HOST('>  '||log_dir||'/ftplog.'||proc_id ||
              ' ; chmod 777 '||log_dir||'/ftplog.'||proc_id,out1);
           dbms_output.put_line('host completed');
    ......
    ......
    ......
    Here is the PLSQL block that I will carry out and also the output on this block
    declare 
    lv_ftp_result boolean; 
    begin 
    lv_ftp_result := u.FTP('XXAR_REV_PA', ' ' || '/u07/app/qaoa083a/data/outgoing/xxar/PARECREV' || '/' || 'REVENUE_20120319014318.dat','REVENUE_20120319014318.dat');  
    IF lv_ftp_result THEN 
    dbms_output.put_line('True'); 
    ELSE 
    dbms_output.put_line('False'); 
    END IF; 
    exception 
    when others then 
    dbms_output.put_line('in exception - '||sqlerrm); 
    end;
    Output:
    host1 begin
    host2 begin
    m=1
    result_out - ERROR : GLCC0005 presumed not running
    not derun
    begin
    Looping
    host
    host1 begin
    host2 begin
    m=1
    in exception - ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    The flow of execution goes like this:
    1 FTP function called from PL/SQL block
    2 inside of the FTP service, the Sub statement calls the HOST function
    log_dir              varchar2(100) := get_env('$APPLCSF')||'/log';
    3. This HOST function in turn calls another function of overloaded HOST (code shown above).
    4. in the function overloaded with the HOST, the following statements are executed successfully, and FALSE is returned by the function
    dbms_output.put_line('m=1');
    result_out := 'ERROR : GLCC0005 presumed not running';
    dbms_output.put_line('result_out - '||result_out);
    5. the remaining code in the FTP service is running and the HOST function is called again using the Sub statement
    res := HOST('echo $$',proc_id);
    6.again, this HOST function in turn calls another function of overloaded HOST (code posted above).
    7. this time, in the function overloaded host, ORA-06502 is thrown when the following statement is executed and the execution stops here that this exception is unhandled.
    result_out := 'ERROR : GLCC0005 presumed not running';
    This statement is very successfully in the previous call to the function of HOST (step 4), but it fails now.

    Any idea on why this error occurs in this scenario? Because the issue of memory?

    DB Info:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    Kind regards
    Anthony

    Published by: Anthony Alix on March 20, 2012 08:53

    Hello

    HOST (1) calls the function of MODERATOR (2) with his second parameter as result_out

    The first time you call the function of host (1) in the function get_env you use

    ...
     out varchar2(256);
    BEGIN
      res := HOST('echo '||env,out);
    ...
    

    out is big enough varchar2 (256)

    The second time you call (1) HOST of the FTP function as:

    ...
    ftp_main         varchar2(2000);
    proc_id           varchar2(10);
    fderr             varchar2(100);
    ...
    
    ...
              res := HOST('echo $$',proc_id);
              dbms_output.put_line('proc_id - '||proc_id);
    ...
    

    Here, use you proc_id which is varchar2 (10)

    And it's not big enough!

    Kind regards

    Peter

  • Problem with error ORA-06502: PL/SQL: numeric string or the error value

    Hello

    I use a loop for the coil just out of data using 'dbms_output.put_line' and I get this error after a few records. I've been using and it happens at a different interval. He would have to do with the length of the question, I am trying to spool? Thank you.

    ORA-06502: PL/SQL: numeric string or the error value

    SD wrote:
    Hello

    I use a loop for the coil just out of data using 'dbms_output.put_line' and I get this error after a few records. I've been using and it happens at a different interval. He would have to do with the length of the question, I am trying to spool? Thank you.

    ORA-06502: PL/SQL: numeric string or the error value

    Yes, it's a mistake to dependent data.

    Manage: SD
    Status level: Beginner
    Join date: November 21, 2001
    Messages total: 289
    Total Questions: 189 (183 pending)

    Why wasting you time here when you get rarely answers your questions?

  • ORA-06502: PL/SQL: digital error: error in the conversion of char to number

    Hello world.

    I have a strange problem here. I'll try to explain better. I work with APEX 4.2 and of Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production.

    Here are my parameters NLS_SESSION_PARAMETER and NLS_DATABASE_PARAMETER: NLS_NUMERIC_CHARACTERS,.


    I have a table with a lot of body numbers, and when I imported a MS Access application data, all fields were imported with the comma as decimal separator.


    Now, I have a form with several fields of number and when I leave a numeric field, a body of numbers of amount total is calculated and automatically filled with a bit of javascript.


    Now the problem: calculating fields (sum) succeeds only when I use the decimal as the delimiter. If I use the comma, I get a NaN value in the total amount field. I managed to convert all commas in points with javascript, so the total amount is calculated.

    When I try to save the record, I get the error: ORA-06502: PL/SQL: digital error: error in the conversion of char to number because I'm trying to save the separator point in my number fields.


    I tried to use REPLACE function to replace the. by one, before winning but does not solve the problem.


    This sounds familiar to anyone?


    Thanks in advance.



    OK, the problem is solved people.

    Somehow, the registration procedure had an influence on another calculation of my form and the error came from this process. So I put a to_number and replace stated in the calculation and all records very well and it shows my total.

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

    Hello gurus,

    I get the following error:
    ORA-06502: PL/SQL: digital or value error: character of number conversion error

    It happens on wizard generated in a table.
    DECLARE
    v_venue_prsntd_qtr varchar2(3);
    v_venue_prsntd_fy  number;
    
    BEGIN
    FOR i IN 1 .. apex_application.g_f02.COUNT
      LOOP
        IF apex_application.g_f05 (i) IS NOT NULL THEN 
            v_venue_prsntd_qtr := 
             Case WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('OCT','NOV','DEC') THEN '1'
                  WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('JAN','FEB','MAR') THEN '2'
                  WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('APR','MAY','JUN') THEN '3'
                  ELSE '4'
                  END;
      -- INTO v_venue_prsntd_qtr
      -- FROM venue_prsntd
      -- WHERE venue_prsntd_seqno = apex_application.g_f02 (i) 
      -- AND dfcy_seqno = apex_application.g_f03 (i)
      -- AND apex_application.g_f05 (i) IS NOT NULL; 
    ----fiscal year
     --    v_venue_prsntd_fy := 
     --       CASE WHEN TO_CHAR(TO_NUMBER(TO_CHAR(apex_application.g_f05(i), 'MMDD'))) < 1001 THEN --------TO_CHAR(apex_application.g_f05 (i),'YYYY')
    --        ELSE TO_CHAR(TO_NUMBER(TO_CHAR(apex_application.g_f05 (i),'YYYY')) + 1) 
    --      END;
    
       --  INTO v_venue_prsntd_fy
       --  FROM venue_prsntd
       --  WHERE venue_prsntd_seqno = apex_application.g_f02 (i) 
       --  AND dfcy_seqno = apex_application.g_f03 (i) 
       --  AND apex_application.g_f05 (i) IS NOT NULL; 
       --  
    ---END IF;
      --- IF apex_application.g_f02 (i) IS NULL AND apex_application.g_f05 (i) IS NOT NULL Then 
              -- INSERT INTO venue_prsntd(venue_prsntd_qtr, venue_prsntd_fy)
              --                   VALUES(v_venue_prsntd_qtr, v_venue_prsntd_fy);
                 UPDATE VENUE_PRSNTD
                      SET VENUE_PRSNTD_QTR = to_number(v_venue_prsntd_qtr)
                         -- VENUE_PRSNTD_FY = v_venue_prsntd_fy
                 WHERE VENUE_PRSNTD_SEQNO = APEX_APPLICATION.G_F03(i);
    END IF;
    END LOOP;
    END;
    I'm trying to update venue_prsntd_qtr. I commented all the rest to see if I can limit the error is coming from.

    QTR is a numeric field in the database. I have gone back and forth with the variable type in the code and still get the same error.

    I use oracle db 10g, apex 3.2.1

    Thank you
    Mary

    Hi, I don't think it's possible to integrate with the routine auto mru. What you can do is to use a trigger to insert database after the cessation of the to do.

    Otherwise, you will still need a separate process Apex which runs after the SRM process.

    Luis

  • 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

  • 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?

  • ORA-06502: PL/SQL: digital error or the value in the conversion for a long TIME on the CLOB type

    Hello

    I have an EA of RDBMS Oracle 11.2.0.4.

    I ger the following error when I try to convert a data type LONG to type CLOB data thanks to a PL/SQL procedure:

    declare
    v_prefix varchar2 (20): = null;
    v_text_view_clob clob: = null;
    long v_text_view_long: = null;

    cursor c_v
    is
    Select
    a.view_name as view_name
    Of
    USER_VIEWS one;

    Start
    for r_v in c_v
    loop
    Start
    v_text_view_clob: = null;
    v_text_view_long: = null;

    -Do the SQL code of the view
    Select
    a.Text text
    in
    v_text_view_long
    Of
    USER_VIEWS one
    where
    a.view_name = r_v.view_name;

    v_text_view_clob: = v_text_view_long;

    update of ohibo_views one
    set
    a.view_text = v_text_view_clob
    where
    a.view_name = r_v.view_name;
    exception
    while others then
    dbms_output.put_line ('View =' | r_v.view_name |) "kan niet worden geconverteerd!");
    dbms_output.put_line (substr (sqlerrm, 1, 60));
    end;
    end loop;
    -commit;
    exception
    while others then
    lift;
    end;
    /

    I get the error a specific record:

    View = VER_POLISMUTATIES_VW kan niet worden geconverteerd!

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

    At looked the origina; Value of type LONG and it is indeed a "long" piece of text.

    However, CLOB has a restriction about 4G * db_block_size and LONG 2 G - 1 according to the documentation.

    I should be able with the method above to convert a LONG in CLOB.

    Anyone had a similar situation?

    Thanks in advance for advice how to solve.

    Kind regards

    PS: my apologies, I didn't know which group to post this discussion: database or PL/SQL.

    Good indeed, a link with the right explanation.

    I didn't know that there was such a function.

    Thank you!

    Kind regards

  • 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.

  • 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

  • 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

  • ORA-06502: PL/SQL: digital or value error: character conversion number e

    Hi all
    I work with DBLOCALE , which is
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE     10.2.0.3.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
    NLSRTL Version 10.2.0.3.0 - Production
    and DBREMOTE
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE     9.2.0.8.0     Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    Leave a procedure on DBLOCALE I run SCHEMA. MYPROCEDURE@dbremote (NUMBER, stringPar VARCHAR2, datePar DATE numberPar)

    I use this procedure only to call a function in a package of DBREMOTE with education booleanresult: = MYPACKAGE. MYFUNC (NUMBER, stringPar VARCHAR2, datePar DATE numberPar)

    In the service, I try to INSERT IN MYTABLE (numberPar, stringPar, datePar) and the error
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    is triggered.

    I missed something basic? Where is my mistake?

    I have check all types of past data and types of data in the table, that I have to insert.

    Any help or suggestion will be appreciated. Feel free to ask me any questions that need me to explain or for more details.

    Best regards
    Alex

    OraclePSP wrote:

    It starts with a page of APEX who call a procedure in DBLOCALE.

    Apex point (page) variables are all text - and bind as text variables when used in PL/SQL and SQL code.

    In this procedure, ii assess the past, then insert into a few tables@DBREMOTE without errors.
    The end of it, I'm calling the remote packaged function.
    In the function I use parameters to open a cursor and insert into MYTABLE.

    That you pass as parameters? The variable element of Apex (e.g. : P1_DATE) or do you attribute the object variable to a PL/SQL variable and the neck of the PL/SQL variable as a parameter?

    Even if I agree with you on the copy & paste I don't know what part of the process, I can speak to you.

    Well, you can try the following. Create a dynamic PL/SQL region on the page. This region should be implemented and made that the page has been sent (in other words, element variables used in the page need value for this region, for the record). You can create a condition for this region that must be met to be made - and this can check the QUERY variable, or to check if the relevant variables have values.

    In this dynamic PL/SQL code for the region block, use HTP.prn () as you would use DBMS_OUTPUT.put_line () in client-server test normal (using TOAD or SQL * more). And in this block of code, call the remote procedure.

    For example

    --// dynamic PL/SQL region code block:
    HTP.prn( 'Item P1_DATE = ['||:P1_DATE||'] 
    ' ); HTP.prn( 'Item P1_NUMBER = ['||:P1_NUMBER||']
    ' ); ..etc.. HTP.prn( 'Calling remote procedure:
    ' ); begin RemoteProc@RemoteDB( param1=>:P1_DATE, param2=>:P1_NUMBER ); HTP.prn( 'Call was successful
    ' ); exception when OTHERS then HTP.prn( 'Call failed with: '||SQLERMM(SQLCODE)||'
    '); end; ..etc..
  • 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

  • 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.

  • 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})?$')
    

Maybe you are looking for

  • Load OSX on 2014 macbook air problems

    Hey guys, dude this device telling me that he had bought earlier by someone who had deleted the info private and he has said that he needs to enter the password to access the desktop computer. The thing is, no matter what he tried it is not on the de

  • Bluetooth

    I have a laptop with mac macbook air OS X el Captain 10.11.5 and an iPhone with iOS 9.3.2,and 6 both on a wifi modem router from netgear. I can't use bluetooth or airdrop. I have paired other mobiles with bluetooth mobile tony but cannot then get iPh

  • Impossible to download book

    Strange situation: find a book to buy on the ibook store tap on the price AKS me if I want to buy, I confirm request password or fingerprint, that I offer accepts, goes to download (small circle apperas) After a few second circle dissolves and price

  • Read the wav file

    Hi all is it possible to play a wav file and then treat it? Thank you

  • Bike G - what version should I

    Hi all Am a new user of the G and I was wondering how do I know if I have a 2nd generation or? Thank you EDIT - title edited for clarity - Alphadog