apex_json throws ORA-06502

Hello

I use 5 APEX and must work with GEOJSON.

If I test the following statement in SQL Developer, everything works fine:

DECLARE
    s varchar2(32767) := '{ "a": 1, "b": ["hello", "world"]}';
BEGIN
    apex_json.parse(s);
    sys.dbms_output.put_line('a is '||apex_json.get_varchar2(p_path => 'a'));
END;

But if I change the JSON data to the following:

s varchar2(32767) := '{ "a": 1.1, "b": ["hello", "world"]}';

I get this error:

Fehler beim Start in Zeile : 1 in Befehl -
DECLARE
    s varchar2(32767) := '{ "a": 1.1, "b": ["hello", "world"]}';
BEGIN
    apex_json.parse(s);
    sys.dbms_output.put_line('a is '||apex_json.get_varchar2(p_path => 'a'));
END;
Fehlerbericht -
ORA-06502: PL/SQL: numerischer oder Wertefehler: Fehler beim Konvertieren von Zeichen zu Zahl
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 367
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 519
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 566
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 756
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 774
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 811
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 839
ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 852
ORA-06512: in Zeile 4
06502. 00000 -  "PL/SQL: numeric or value error%s"
*Cause:    
*Action:

The same thing happens with with MyMethod...

sys.dbms_output.put_line('a is '||apex_json.get_number(p_path => 'a'));

Because I work with GEOJSON, there are decimal numbers in my JSON data - I have to deal with.

I have not found any suspicion in the apex_json documentation.

How can I solve this problem?

Kind regards

Christian

Hello

your example works fine for me on 5.0.2. There were a few bugs that fixed us since 5.0. Some may be available as SAFF, but maybe you need to upgrade to the latest version.

Kind regards

Christian

Tags: Database

Similar Questions

  • SDO_NET. VALIDATE_NETWORK throwing error ORA-06502

    I generated a network but also created a partition. Before you create the partition, I run SDO_NET. VALIDATE_NETWORK and that's fine.

    I perform partitioning with the following procedures:
    execute sdo_net.spatial_partition('LRS_NETWORK', 'LRS_NETWORK_PART', 2500, 'LRS_NETWORK_PARTITION_DIR', 'lrs_network_part.log', 'W', 1);
    execute sdo_net.generate_partition_blobs('LRS_NETWORK', 1,'LRS_NETWORK_PART_BLOB', true, true, 'LRS_NETWORK_PARTITION_DIR', 'lrs_network_part_blob.log', 'W', false, false);
    Both all fine, and I don't see any errors in the logs. They can be provided if necessary. Note that the meter on my partition table, after it is 0, and my BLOB table has a 1 meter.

    So I now run SDO_NET. VALIDATE_NETWORK and the following errors occur when the procedure runs:
    [Error] Script lines: 1-1 --------------------------
     ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "MDSYS.SDO_NET", line 2467
    ORA-06512: at line 1
     Script line 1, statement line 1, column 7
    In addition, there seems to be 2 other functions without papers: SDO_NET. VALIDATE_PARTITION_INFO and SDO_NET. VALIDATE_CONSISTENCY. I was curious, so I ran to them, this is the result I get:

    SDO_NET. VALIDATE_PARTITION_INFO ('LRS_NETWORK', 'TRUE')
    Inconsistent link_level information between partition table, and partition blob table! (min: ,max: ,count:0 ) vs. (min:1 ,max:1 ,count:1)  
    Inconsistent total no. of nodes between node table and partition table at link_level:1! (5227 vs. 0) Partition blob table contains 1 inconsistent (partition,,link_level) pair(s) vs. partition table!   
    Partition blob table contains 1 partition(s) with inconsistent no. of nodes vs. partition table at link_level:1!  5227 node(s) with unassigned partition_id  in the partition table at link_level:1!  
    MDSYS. SDO_NET. VALIDATE_CONSISTENCY ('LRS_NETWORK', 'TRUE')
     Node table has 5227 node(s) while partition table has 0 node(s); 
    Not sure if I should be concerned here. FYI, I'm using Oracle 11 g 2. My network is a network space, not LRS as you might suppose. Here is the metadata for my network:

    NETWORK:     LRS_NETWORK
    NETWORK_ID: 62
    NETWORK_CATEGORY:     SPACE
    GEOMETRY_TYPE:     SDO_GEOMETRY
    NETWORK_TYPE:     (null)
    NO_OF_HIERARCHY_LEVELS: 1
    NO_OF_PARTITIONS: 1
    LRS_TABLE_NAME:     (null)
    LRS_GEOM_COLUMN:     (null)
    NODE_TABLE_NAME:     LRS_NODES
    NODE_GEOM_COLUMN:     GEOMETRY
    NODE_COST_COLUMN:     COST
    NODE_PARTITION_COLUMN:     (null)
    NODE_DURATION_COLUMN:     (null)
    LINK_TABLE_NAME:     LRS_LINKS
    LINK_GEOM_COLUMN:     GEOMETRY
    LINK_DIRECTION:     REALIZED
    LINK_COST_COLUMN:     COST
    LINK_PARTITION_COLUMN:     (null)
    LINK_DURATION_COLUMN:     (null)
    PATH_TABLE_NAME:     LRS_PATHS
    PATH_GEOM_COLUMN:     GEOMETRY
    PATH_LINK_TABLE_NAME:     LRS_PATHS_LINKS
    SUBPATH_TABLE_NAME:     (null)
    SUBPATH_GEOM_COLUMN:     (null)
    PARTITION_TABLE_NAME:     LRS_NETWORK_PART
    PARTITION_BLOB_TABLE_NAME:     LRS_NETWORK_PART_BLOB
    COMPONENT_TABLE_NAME:     (null)
    NODE_LEVEL_TABLE_NAME:     (null)
    TOPOLOGY:     (null)
    USER_DEFINED_DATA:     THERE
    EXTERNAL_REFERENCES:     (null)


    Thank you, Tom

    Tom,

    The geometry of your node is a point LRS geometry (gtype = 3301). Point 2D geometry is of the following form:

    SDO_GEOMETRY)
    2001,
    41104,
    SDO_POINT (x, y, NULL),
    NULL,
    NULL));

    You can convert the geometry lrs in standard 2D geometry with the procedures mentioned in my previous post and see if that solves your problem.

    Jack

  • RAISE_APPLICATION_ERROR gets ORA-06502 when a Message is of 198 characters or more

    Hello

    I see a problem in our 10.2.0.4 database where RAISE_APPLICATION_ERROR Gets an ORA-06502: PL/SQL: digital or value error: error string too small buffer when a value of 198 characters or more are passed in the msg parameter. The anonymous block below is an example of when the error occurs.


    DECLARE

    lv_error_msg VARCHAR2 (4000): = NULL;

    BEGIN
    -198 tank DOES NOT work.
    lv_error_msg: = LPAD('$',198,'$');

    IF (lv_error_msg IS NOT NULL) THEN
    RAISE_APPLICATION_ERROR(-20100,lv_error_msg);
    END IF;

    END;

    It's just a demo simple to show more or less happens in an application and not the exact code used in the application. Does anyone know why this would throw the ORA-06502 during the passage of 198 characters or more? I should be able to convey much more than that.

    Thanks for any idea!

    Mike

    user2486268 wrote:
    SQL > midd_dba.mc_sysevent desc;

    Here's the answer:

    ORA_SERVER_ERROR_MSG VARCHAR2 (200 CHAR)

    Look at this part of the trigger:

    FOR i IN 1..v_rec.ora_server_error_depth LOOP
    midd_dba.mc_widgets.string_together(v_rec.ora_server_error_msg,ora_server_error_msg(i));
    END LOOP get_errors;
    

    Another potential place causing the error is:

    ORA_SERVER_ERROR_PARAM VARCHAR2 (200 CHAR)

    a code he fill:

    FOR i IN 1..v_rec.ora_server_error_num_params LOOP
    v_rec.ora_server_error_param:=v_rec.ora_server_error_param||i||'='||ora_server_error_param(1,i)||' ';
    END LOOP get_parms;
    

    SY.

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

  • APEX 5.0. With the image stored in a BLOB gives ORA-06502.

    Hello

    I want to create an interactive report - computer desk with an image that is stored in a BLOB but it a: returnes ORA-06502: PL/SQL: digital or value error: character of number conversion error.

    I created a test with only the image report (charged - which is a BLOB) and an ID (PK - one number from a sequence)

    SELECT ID, invoice of foto

    I tried with and without a formatmask for the ' 999999999999999 ID' and the Type of plain text, because it seems not to be a better choice...

    For the Type 'pay' is 'View Image' and the 'Table name' and 'BLOB column' are defined. 'Primary Key column 1' set ID 'column of Type mime"points to a field that contains" image/jpeg", as the stored image is a photo in format jpg.

    The image from a Forms application displays OK.

    DB is a 11.2.0.4 on Linux 6.6 and APEX is 5.0

    What did I miss?

    Thank you

    Dino

    Dino Hustinx wrote:

    I want to create an interactive report - computer desk with an image that is stored in a BLOB but it a: returnes ORA-06502: PL/SQL: digital or value error: character of number conversion error.

    I created a test with only the image report (charged - which is a BLOB) and an ID (PK - one number from a sequence)

    SELECT ID, invoice of foto

    As described in the documentation, the report query selects the length of the BLOB, not the column itself column:

    select id, dbms_lob.get_length(billed) billed from foto
    
  • 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.

  • DBMS_STATS.gather_schema_stats: ORA-06502

    I am trying to run under block to find all objects with stale stats. Is someone can you please tell me what I'm missing?

    Set serveroutput on;

    DECLARE

    ObjList dbms_stats. ObjectTab;

    BEGIN

    DBMS_STATS. GATHER_SCHEMA_STATS (ownname = > null, OPTIONS = > "LIST out of DATE", objlist = > ObjList);

    FOR i IN ObjList.FIRST... ObjList.LAST

    LOOP

    dbms_output.put_line (ObjList (i). ObjName | ' ' || ObjList (i). Type of the object);

    END LOOP;

    END;

    /

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

    ORA-06512: at line 5

    06502 00000 - "PL/SQL: digital error or the value of %s.

    * Cause: A digital arithmetic error, String, conversion or coercion

    has occurred. For example, this error occurs if an attempt is made to

    assign the NULL value to a variable declared NOT NULL, or if a

    attempt to assign an integer greater than 99 to a variable

    NUMBER (2) declared.

    * Action: Change the data, how it is handled, or how it is so declared

    that values do not violate the constraints.

    Using the Oracle 12 c on Windows 7 version

    You do not currently have all stale stats, so the dbms_stats. ObjectTab is empty.  Take into account:

    SQL > create type test_type as the object)

    col1 2 varchar2 (10));

    3.

    Type of creation.

    SQL > create type test_tab as table of test_type.

    2.

    Type of creation.

    SQL > declare

    l_tt 2 test_tab;

    3. start

    4. Select test_type (dummy)

    5 bulk collect into l_tt

    6 double

    7 where 1 = 2;

    8 because I in l_tt.first... l_tt loop. Last

    9 dbms_output.put_line (l_tt (i) .col1);

    10 end of loop;

    11 end;

    12.

    declare

    *

    ERROR on line 1:

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

    ORA-06512: at line 8 level

    You should test if there is in fact no value before attempting to access the object.

    SQL > declare

    l_tt 2 test_tab;

    3. start

    4. Select test_type (dummy)

    5 bulk collect into l_tt

    6 double

    7 where 1 = 2;

    8 if l_tt.count > 0 then

    9 because loop me in l_tt.first... l_tt. Last

    10 dbms_output.put_line (l_tt (i) .col1);

    11 end of loop;

    12 on the other

    13 dbms_output.put_line ('no statistics obsolete');

    14 end if;

    15 end;

    16.

    No stale stats

    PL/SQL procedure successfully completed.

    John

  • ORA-06502 error digital or value of PL/SQL.

    Hi experts,

    Oracle Apex 4.2, 11g database, using windows 7.

    I created a form and trying to create automatically generated # (sequence of not) with logic and SQL.

    My requirement is to generate the good good exercise only and exercise begin from 01 July and ends 30 June each year. This means if the 07/01/2015 start it will create a new voucher No.

    The table name is GL_PV and the columns are:

    Number of PV_No

    Date of PV_Date

    Number of CC_code

    number amount

    Remarks varchar2 (100)

    What I did: -.

    Created a process to submit before the calculations and validations.

    Code are

    IF TO_NUMBER (TO_CHAR (: P15_pv_date, 'MM')) < = 6 THEN

    SELECT MAX (to_number (nvl(pv_no,0))) + 1

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN

    TO_DATE ('01 - JUL' |) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY'))-1), 'DD-MON-YY')

    AND

    TO_DATE (30 - JUN'|) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')

    and cc_code =: P15_cc_code;

    ON THE OTHER

    SELECT MAX (to_number (nvl(pv_no,0))) + 1

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN

    TO_DATE ('01 - JUL' |) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')

    AND

    TO_DATE (30 - JUN'|) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY')) + 1), 'DD-MON-YY')

    and cc_code =: P15_cc_code;

    END IF;

    If: P15_pv_no is null then

    : P15_pv_no: = 1;

    end if;

    and press the button when Conditions = Generate_Button

    I have the default assign to pv_date = sysdate, when I launched the point Pv_date form shows the current date and I click on Generate_button now show error.

    Error ORA-06502 PL/SQL digital or value. Conversation number character.

    One last thing, I checked this code already in TOAD, type I assigned as DATE-value = 10/11/2014 (today's date) works fine without error.

    Please guide what this evil is stated.

    Best regards

    : P15_pv_date is probably not a date but a varchar2 in Apex

    Try this

    NVL SELECT (MAX (to_number (nvl(pv_no,0))) + 1, 1)

    IN: P15_pv_no

    OF GL_PV

    WHERE pv_date

    BETWEEN to_date (' 01-07-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" -1="" else="" 0="" end="" ),="" 'dd-mm-yyyy'="">

    AND to_date (30 - 06-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" 0="" else="" 1="" end="" ),="" 'dd-mm-yyyy'="">

    and cc_code =: P15_cc_code;

  • Unit test: disassembly of the table or restore the line failed: ORA-06502: PL/SQL: digital error or value: string buffer too small ORA-06512: at line 22

    Is any idea available in the process of disassembly of the table or restore the line to line 22?

    I see a bunch of discussions on the subject, but no clear solution/answer...

    What could be the causes of this error?

    I had two process of disassembly on the level now, and one of them had failed with this error. Displacement of the failure of the process of disassembly compared to the level of the suite for the level of performance of test unit solved the error for a while, but after some more dragging the process of disassembly of the table (with about 500 cases) is permanent.

    Please advise...

    Thank you

    Val

    Well, had to create a bug officially... I hope this helps...

    Bug 19696042 : UNIT TEST: disassembly of THE TABLE or LINE RESTORE failed: ORA-06502: STRING BUFFER TOO SMA

    Thank you

    Val

  • Cannot generate the dynamic query - ora-06502

    Hi friends,

    during execution of code below I get the error message: ora-06502 pl/sql numeric or value error on line 11

    I'm not able to open a SQL session table logging.

    DECLARE

    T_Participants TYPE TABLE IS NUMBER;

    c_Participant_Id t_Participants: = t_Participants();

    CLOB V_SQL;

    BEGIN

    Select the participantid COLLECT in BULK IN c_Participant_Id in t_roster_detail

    where rosterid = 10654

    and ba = "MD";

    I'm IN 1.c_Participant_Id.COUNT LOOP

    V_SQL: = V_SQL | "SELECT p.participantid,.

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10331, p.Current_Data, NULL), null) "10331_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10331, p.Goal_Data, NULL), null) "10331_Goal."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9640, p.Current_Data, NULL), null) "9640_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9640, p.Goal_Data, NULL), null) "9640_Goal."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9643, p.Current_Data, NULL), null) "9643_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9643, p.Goal_Data, NULL), null) "9643_Goal."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10332, p.Current_Data, NULL), null) "10332_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10332, p.Goal_Data, NULL), null) "10332_Goal."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10721, p.Current_Data, NULL), null) "10721_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10721, p.Goal_Data, NULL), null) "10721_Goal."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10701, p.Current_Data, NULL), null) "10701_CURRENT."

    Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10701, p.Goal_Data, NULL), null) '10701_Goal '.

    OF t_sce_msr_output_data p

    WHERE IN (SELECT T_PC_AXIS_DEFINITION CREATES CREATES

    WHERE PLANCOMPONENTID IN (SELECT PLANCOMPONENTID FROM T_PLAN_COMPONENT WHERE PLANID = 10702))

    UNION ";

    END LOOP;

    DELETE FROM T_LOGGING_SQL;

    INSERT INTO T_LOGGING_SQL VALUES (V_SQL);

    COMMIT;

    END;

    SQL > desc t_sce_msr_output_data

    Name                                      Null?    Type

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

    IDSCENARIO NOT NULL NUMBER

    CREATES NOT NULL NUMBER

    PARTICIPANTID NOT NULL NUMBER

    NUMBER OF BASELINE_DATA

    NUMBER OF CURRENT_DATA

    NUMBER OF GOAL_DATA

    You are way more complicate things here.  First of all, there is no need at all for dynamic sql because the wy you are querying is incorect.

    Even if you do not have an error, which you query will do is run the query on t_sce_msr_output_data once for each row returned by the cursor.  Each iteration of the query will return all matching rows (i.e. lines for all the participantid in the t_sce_msr_output_data table), then the external decoding will be will force all other NULL columns for all the participantid that do not correspond to the "current" participantid

    The query can be simplified to:

    Select p.participantid,

    Decode (p.Measureid, 10331, p.Current_Data, NULL) "10331_CURRENT."

    Decode (p.Measureid, 10331, p.Goal_Data, NULL) "10331_Goal."

    Decode (p.Measureid, 9640, p.Current_Data, NULL) "9640_CURRENT."

    Decode (p.Measureid, 9640, p.Goal_Data, NULL) "9640_Goal."

    Decode (p.Measureid, 9643, p.Current_Data, NULL) "9643_CURRENT."

    Decode (p.Measureid, 9643, p.Goal_Data, NULL) "9643_Goal."

    Decode (p.Measureid, 10332, p.Current_Data, NULL) "10332_CURRENT."

    Decode (p.Measureid, 10332, p.Goal_Data, NULL) "10332_Goal."

    Decode (p.Measureid, 10721, p.Current_Data, NULL) "10721_CURRENT."

    Decode (p.Measureid, 10721, p.Goal_Data, NULL) "10721_Goal."

    Decode (p.Measureid, 10701, p.Current_Data, NULL) "10701_CURRENT."

    Decode (p.Measureid, 10701, p.Goal_Data, NULL) '10701_Goal '.

    of t_sce_msr_output_data p

    where in (select creates creates

    of t_pc_axis_definition

    where plancomponentid in (select plancomponentid

    of t_plan_component

    where planid = 10702)) and

    participantid in (select participantid

    of t_roster_detail

    where rosterid = 10654 and

    BA = "MD");

    You probably want to pivot these results by participant, if so look in the note from the FAQ for the columns of the rows.

    John

  • ORA-06502: PL/SQL: digital or value error: character string buffer too small in the functions

    Hi all

    FUNCTION to CREATE or REPLACE fnc_two (p_in_job IN VARCHAR2)

    RETURN VARCHAR2

    AS

    CUR CURSOR

    IS

    SELECT ename

    WCP

    WHERE job = p_in_job;

    v_first_name emp.ename%TYPE;

    BEGIN

    FOR my heart IN rec

    LOOP

    IF v_first_name IS NULL

    THEN

    v_first_name: = rec.ename;

    ON THE OTHER

    v_first_name: = v_first_name | ',' || Rec.Ename;

    END IF;

    END LOOP;

    RETURN v_first_name;

    END;

    SQL > SELECT fnc_two ('CLERK')

    2 FROM dual;

    SELECT fnc_two ('CLERK')

    *

    ERROR on line 1:

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

    ORA-06512: at the 'APPS '. FNC_TWO', line 17

    SQL > select distinct work of emp

    2.

    JOB

    ---------

    CLERK

    SELLER

    PRESIDENT

    MANAGER

    ANALYST

    v_first_name: = v_first_name | ',' || Rec.Ename;

    The above statement is the original error. The value has been assinged to v_first_name is larger than the computer can handle.

    Increase the size of the variable v_first_name to avoid the error example

    v_first_name varchar2 (100);

  • ORA-06502 on cursor fetch dba_triggers

    Oracle 11.2.0.3 SE - One

    Oracle Linux 5.6, 64-bit

    I watched it until I'm blue in the face...

    Procedure uses a loop of CURSOR to scroll dba_triggers and disabling selected triggers.  Going through the result set, I get

    ERROR on line 1:

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

    ORA-06512: at "ESTEVENS. TRUNCATE_SCHEMA', line 66

    ORA-06512: at line 1

    I think I have identified as a particular line by ordering my SELECT cursor, the two ascendant and descendant and is the line that should be the next one is the same of the order.  For example, assume that the returned rows are named "AAA", "BBB", "CCC", etc..  If I includes an ORDER BY ASC TRIGGER_NAME, the last row before reports error is "FFF", then any error during playback of what should be 'GGG '.  If I ORDER BY DESC TRIGGER_NAME, the last row reports until the error is "HHH", even once any error during playback of what should be 'GGG '.

    Code of procedure is

    create or replace

    procedure truncate_schema (i_schema in varchar2)

    is

    type usrtbl_typ is ref cursor return % ROWTYPE dba_tables;

    cv_usrtbl usrtbl_typ;

    v_usrtbl dba_tables % ROWTYPE;

    type usrconstraint_typ is ref cursor return sys.dba_constraints%ROWTYPE;

    cv_usrconstraint usrconstraint_typ;

    v_usrconstraint sys.dba_constraints%ROWTYPE;

    type usrtrigger_typ is ref cursor return sys.dba_triggers%ROWTYPE;

    cv_usrtrigger usrtrigger_typ;

    v_usrtrigger sys.dba_triggers%ROWTYPE;

    date of T_DATE;

    v_sql varchar2 (20000);

    number of v_rowcnt;

    Start

    Select sysdate in double T_DATE;

    dbms_output.put_line ('Run time is' | to_char (T_DATE,' dd-mon-yyyy hh24:mi:ss'));))

    --

    dbms_output.put_line (' processing user ' | i_schema);

    --

    -Disable all triggers on the tables in the selected schema

    --

    dbms_output.put_line (' '... triggers ");

    Select count (*)

    in v_rowcnt

    of dba_triggers

    where table_owner = i_schema;

    dbms_output.put_line (' treatment ' | v_rowcnt |) "triggers");

    v_rowcnt: = 0;

    Open the cv_usrtrigger for

    Select * from sys.dba_triggers

    where table_owner = i_schema

    order by the owner,

    trigger_name desc;

    loop

    extract the cv_usrtrigger in v_usrtrigger;

    When the output cv_usrtrigger % NOTFOUND;

    v_sql: = 'alter trigger' |

    v_usrtrigger. Owner |

    '.' ||

    v_usrtrigger.trigger_name |

    "disable."

    v_rowcnt: = v_rowcnt + 1;

    dbms_output.put_line (v_rowcnt |') -' || v_sql);

    -execution immediate v_sql;

    end loop;

    close cv_usrtrigger;

    end truncate_schema;


    The sample output:


    SQL > exec truncate_schema ('DW')

    Run time is June 5, 2014 10:56:09

    Processing user DW

    ... triggers

    Treatment of 54 triggers

    1 - alter trigger DW. < delete name for public consumption >

    2 - alter trigger DW. < delete name for public consumption >

    -snip unnecessary repetition-

    30 - alter trigger DW. < delete name for public consumption >

    BEGIN truncate_schema ('DW'); END;

    *

    ERROR on line 1:

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

    ORA-06512: at "ESTEVENS. TRUNCATE_SCHEMA', line 66

    ORA-06512: at line 1

    SQL >


    I was starting to suspect may be a corruption of data dictionary (stable in the dev database), but I was able to repeat the error (and on the same named trigger!) in another data base which is a DUPLICATE of the production of rman.


    Oops, I missed you select all of the columns in dba_triggers. You probably have a trigger with TRIGGER_BODY > 64767 bytes. Exclude TRIGGER_BODY go select and I'm almost certain that you will be OK.

    SY.

  • 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

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

Maybe you are looking for