ORA-6502: value or numeric error

Hi all,
First off all, I am not very good in PL/SQL so please bear with me:
I have a trigger on a table on after update event. Sample code of the trigger:
create or replace trigger t1
on table1
after update of col1
for each row
begin
for inx in varray1.first .. varray1.last
loop
do something;
end loop;
end;
This trigger throws an error saying "ORA-6502: value or numeric error" if I am trying to update anything into that table but the same trigger works fine when I remove "FOR EACH ROW" statement from the trigger. There is absolutely no change except removal of FOR EACH ROW clause.
I am unable to figure out why. Do anybody?
Thanks in adnvace.

Thanks a lot to all of you for taking time to answer my question.
Again, let me rephrase my question in one single line:
bold Why does the trigger without FOR EACH ROW works and doesnt work with FOR EACH ROW?
What I am guessing is , it might be because of the array what we are using inside the trigger. But its just a guess. One more thing to note here, same code with and without FOR EACH ROW works when I am not using any arrays inside the trigger and thats what is the question. WHY cant same code works when used with FOR EACH ROW when arrays are used inside the trigger.
I am not requesting anybody to write code for me or rectify the problems in the code. All I am interested in is the reason of trigger not working with FOR EACH ROW when arrays are used inside the trigger.
Thanks

Similar Messages

  • ORA-6502 Value or Numeric Error while connecting to Sql-Plus - URGENT

    Hello,
    I am getting ORA-6502 error, "Error accessing Package Dbms_application_info" everytime I connect to Sqlplus. I tried running catproc and catalog but still getting the same message. I dont get this message when I connect to SVRMGR. I am not able to perform export also due to this error. Can anybody help me please??
    Thanks,
    R. Magesh.

    Hello,
    I am getting ORA-6502 error, "Error accessing Package Dbms_application_info" everytime I connect to Sqlplus. I tried running catproc and catalog but still getting the same message. I dont get this message when I connect to SVRMGR. I am not able to perform export also due to this error. Can anybody help me please??
    Thanks,
    R. Magesh. Did you run catproc and catalog as SYS while the database was opened in RESTRICT mode? If not, then do that. Also, do SELECT * FROM dba_objects WHERE status='INVALID'; to see if there are other invalid objects that need to be compiled.

  • ORA-6502, "PL/SQL numeric or value error"

    I am having the [ORA-6502, "PL/SQL numeric or value error"] error when I call this procedure in PRE-INSERT trigger.
    CREATE OR REPLACE PROCEDURE L_CHECK_BAL_AMOUNT(P_TXN_CODE IN VARCHAR2,
    P_ABAL_MAIN_ACNT_CODE IN VARCHAR2,
    P_TD_DOC_DRCR_FLAG IN VARCHAR2,
    P_TXN_AMOUNT IN NUMBER) IS
    CURSOR C1 IS
    SELECT TRAN_CASH_BANK_FLAG
    FROM FM_TRANSACTION
    WHERE TRAN_CODE = P_TXN_CODE;
    CURSOR C2 IS
    SELECT nvl(SUM(NVL(ABAL_LC_MTD_DR,0)) - SUM(NVL(ABAL_LC_MTD_CR,0)) + SUM(NVL(ABAL_LC_UNP_DR,0)) - SUM(NVL(ABAL_LC_UNP_CR,0)),0)
    FROM FS_CUR_ACNT_BAL
    WHERE ABAL_MAIN_ACNT_CODE = P_ABAL_MAIN_ACNT_CODE
    AND EXISTS (SELECT 'X' FROM FM_MAIN_ACCOUNT
    WHERE MAIN_ACNT_CATG IN ('CA','BA')
    AND MAIN_ACNT_CODE = ABAL_MAIN_ACNT_CODE)
    GROUP BY ABAL_MAIN_ACNT_CODE;
    M_BAL_AMOUNT NUMBER(20);
    M_CASH_BANK_FLAG OW_FS.FLAG%TYPE;
    BEGIN
    IF P_ABAL_MAIN_ACNT_CODE IS NOT NULL THEN
    insert into temp values('01',P_TXN_CODE);
    insert into temp values('02',P_ABAL_MAIN_ACNT_CODE);
    insert into temp values('03',P_TD_DOC_DRCR_FLAG);
    insert into temp values('04',P_TXN_AMOUNT);
    commit;
    IF NVL(P_TD_DOC_DRCR_FLAG,'X') = 'C' THEN
    insert into temp values('3',P_TD_DOC_DRCR_FLAG);
    commit;
    IF C1%ISOPEN THEN
    CLOSE C1;
    END IF;
    OPEN C1;
    FETCH C1 INTO M_BAL_AMOUNT; --------ERROR HERE-----------
    IF C1%FOUND THEN
    insert into temp values('2','c1 found');
    commit;
    END IF;
    CLOSE C1;
    END IF;
    END IF;
    END;
    can anybody tell me why the error is coming...?
    The value for the CURSOR C2 is (-1335142)
    Thanks

    yes correct. the procedure would have been written like this.(see cursor C1 and C2)
    CREATE OR REPLACE PROCEDURE L_CHECK_BAL_AMOUNT(P_TXN_CODE IN VARCHAR2,
    P_ABAL_MAIN_ACNT_CODE IN VARCHAR2,
    P_TD_DOC_DRCR_FLAG IN VARCHAR2,
    P_TXN_AMOUNT IN NUMBER) IS
    CURSOR C2 IS
    SELECT TRAN_CASH_BANK_FLAG
    FROM FM_TRANSACTION
    WHERE TRAN_CODE = P_TXN_CODE;
    CURSOR C1 IS
    SELECT nvl(SUM(NVL(ABAL_LC_MTD_DR,0)) - SUM(NVL(ABAL_LC_MTD_CR,0)) + SUM(NVL(ABAL_LC_UNP_DR,0)) - SUM(NVL(ABAL_LC_UNP_CR,0)),0)
    FROM FS_CUR_ACNT_BAL
    WHERE ABAL_MAIN_ACNT_CODE = P_ABAL_MAIN_ACNT_CODE
    AND EXISTS (SELECT 'X' FROM FM_MAIN_ACCOUNT
    WHERE MAIN_ACNT_CATG IN ('CA','BA')
    AND MAIN_ACNT_CODE = ABAL_MAIN_ACNT_CODE)
    GROUP BY ABAL_MAIN_ACNT_CODE;
    M_BAL_AMOUNT NUMBER(20);
    M_CASH_BANK_FLAG OW_FS.FLAG%TYPE;
    BEGIN
    IF P_ABAL_MAIN_ACNT_CODE IS NOT NULL THEN
    insert into temp values('01',P_TXN_CODE);
    insert into temp values('02',P_ABAL_MAIN_ACNT_CODE);
    insert into temp values('03',P_TD_DOC_DRCR_FLAG);
    insert into temp values('04',P_TXN_AMOUNT);
    commit;
    IF NVL(P_TD_DOC_DRCR_FLAG,'X') = 'C' THEN
    insert into temp values('3',P_TD_DOC_DRCR_FLAG);
    commit;
    IF C1%ISOPEN THEN
    CLOSE C1;
    END IF;
    OPEN C1;
    FETCH C1 INTO M_BAL_AMOUNT; --------ERROR HERE-----------
    IF C1%FOUND THEN
    insert into temp values('2','c1 found');
    commit;
    END IF;
    CLOSE C1;
    END IF;
    END IF;
    END;
    /

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

    Hi,
    I'm trying to create an UI Template. I've generated the html using Frontpage and am successfully able to see in a browser.
    I've copied the html to the UI form, but when I try to preview or execute the UI template, I get the following error:
    Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-11230)
    null

    I AM FACING SIMILAR PROBLEM, THE EXACT ERROR IS:
    Error: Excepcisn de wwv_generate_component.build_procedure (WWV-01821)
    No se ha podido generar la pantalla de interfaz de usuario: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-16409)
    (SORRY , PART OF THE ERROR IS IN SPANISH!)
    I CREATED A FORM , WORKED WITH IT A LOT WITHOUT PROBLEMS. NOW I NEED TO DO SOME CHANGES ON CERTAIN FIELDS AND WHEN I TRY TO SAVE IT I GET THE ABOVE ERROR.
    THEN I GO BACK TO AN OLDER VERSION, COPY AND TRY TO DO CHANGES AND AGAIN THE ERROR COMES UP.
    THE CHANGES I AM TRYING TO DO ARE TO SOME OF THE EXISTING FIELDS IN THE FORM WHICH NEED TO BE PUT AS "INSERTABLE".
    THE SCREEN LAYOUT IS DISPLAYED WITHOUT PROBLEM.
    (THE FORM IS BASED ON A TABLE WITH APROX 80 FIELDS).
    I NEED SOME URGENT HELP. PLS LET ME KNOW ANY OTHER INFO YOU MAY NEED TO HELP ME SOLVE THIS PROBLEM.
    FYI I AM WORKING ON PORTAL VERSION 3.0.9 / ON Windows 2000 (DATABASE 8.1.7.0 AND iAS ARE ON DIFFERENT MACHINES).
    TKS IN ADVANCE

  • ORA-6502:  PL/SQL: numeric or value error: Character string buffer too small

    I then ran the sql in APEX- SQL tool and got the following error
         URL Encoded SQL length exceeds 32k limit
    Is there a paramter that controls this value or is my only option to shrink the column data in the intractive report ?
    Note:  Toad renders data for the SQL - only an issue in APEX.
    Thanks

    Issue in APEX, sorry.. You will need to shrink the # of characters you are returning down in your select....
    Thank you,
    Tony Miller
    LuvMuffin Software

  • ORA-6502 - Help!

    I keep receiving this error:
    ORA-6502 - PL/SQL: numeric or value error: character string buffer is too small
    Listed below is the code:
    Error lines are Line 1 and 12.
    create or replace function overpunch (ora_val in varchar2) return varchar2
    is
    result_hold varchar2(12);
    rightmost_digit varchar2(1);
    overpunch_char varchar2(1);
    begin
    Result_hold := to_char( to_number( abs( nvl(ora_val,0) ) ), '000000000009');
    rightmost_digit := substr(result_hold, -1);
    result_hold := substr(result_hold, 1, length(result_hold)-1);
    if ora_val < 0 then
    if rightmost_digit = 0 then
    overpunch_char := '}';
    else
    overpunch_char := chr(ascii(rightmost_digit)+25);
    end if;
    else
    if rightmost_digit = 0 then
    overpunch_char := '{';
    else
    overpunch_char := chr(ascii(rightmost_digit)+16);
    end if;
    end if;
    return result_hold||overpunch_char;
    end;
    This is how it is executed:
    select overpunch(14), overpunch(-14) from dual;
    Any help would be greatly appreciated.

    SQL> create or replace function overpunch (ora_val in varchar2) return varchar2
      2  is
      3  result_hold varchar2(12);
      4  rightmost_digit varchar2(1);
      5  overpunch_char varchar2(1);
      6  begin
      7  Result_hold := to_char( to_number( abs( nvl(ora_val,0) ) ), 'FM000000000009');
      8  rightmost_digit := substr(result_hold, -1);
      9  result_hold := substr(result_hold, 1, length(result_hold)-1);
    10
    11  if ora_val < 0 then
    12  if rightmost_digit = 0 then
    13  overpunch_char := '}';
    14  else
    15  overpunch_char := chr(ascii(rightmost_digit)+25);
    16  end if;
    17  else
    18  if rightmost_digit = 0 then
    19  overpunch_char := '{';
    20  else
    21  overpunch_char := chr(ascii(rightmost_digit)+16);
    22  end if;
    23  end if;
    24
    25  return result_hold||overpunch_char;
    26  end;
    27  /
    Function created.
    SQL> select overpunch(14), overpunch(-14) from dual;
    OVERPUNCH(14)
    OVERPUNCH(-14)
    00000000001D
    00000000001M

  • OAS 4.0.8 PL/SQL Catridge exception ORA-6502 (Numeric or value error)

    Hello,
    Out product is using OAS 4.0.8.2 on UNIX running SOlaris. We are using Oracles Web Toolkit for application development and
    presentation. I am basically trying to fill up some HTML form fields and calling
    an HTTP post procedure in response
    to a user clicking a submit button.
    For some reason the PL/SQL cartridge throws an ORA-6502 error(Numeric or value error). Is there any restrictions to the
    string types that can be passed to an HTTP
    post procedure ??
    Any pointers would be greatly appreciated ?
    Thanks,
    Ricko
    null

    We have fixed the problem !!! :-DDD
    Thanks to all Oracle analysts who replied this issue.
    aLeX
    [email protected]

  • -6502 ORA-06502: PL/SQL: numeric or value error when using 'Create CAPI Definition'

    I get an error when I try to create a CAPI definition with Headstart untilities (6i). I use HSU_CAPI revision 6.5.2.0
    The detailed information says the following:
    Message
    BLAPI.OPEN_ACTIVITY
    Start HSU_CAPI.run
    Number of Tables to create CAPI for 1
    Initial checks for table KCS_TENDERS with id 692754610572409851363604771392473242
    HSU_CAPT.initial_checks for table KCS_TENDERS
    HSU_CAPF.initial_checks for table KCS_TENDERS
    HSU_CAPC.initial_checks Custom Services for table KCS_TENDERS
    HSU_CAPB.initial_checks BRDD for table KCS_TENDERS
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    KCS_TENDERS Business Rule Design Definition BR_TNR001_CEV does not have any Trigger Columns. Rule will fire when any column is updated.
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    Creating CAPI for table KCS_TENDERS with id 692754610572409851363604771392473242
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Insert-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Update-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Insert-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Update-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Delete-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-row, Save old data.
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCODE number of text lines = 404 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCODE number of text lines = 17 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCODE number of text lines = 7 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCODE number of text lines = 144 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCODE number of text lines = 282 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    HSU_CAPF.create_or_find_capi_pack
    hsu_capi.find_plm (kcs_tnr_capi, 692754610572409851363604771392473242, CAPI).
    capi package found in the context folder
    BLPLM.UPD
    FREE_FORMAT_TEXT_FLAG......... = Y
    IMPLEMENTATION_NAME........... = kcs_tnr_capi
    PLSQL_MODULE_TYPE............. = PACKAGE
    SCOPE......................... = PUBLIC
    COMPLETION_STATUS............. = COMPLETED
    NAME.......................... = kcs_tnr_capi
    PURPOSE....................... = Custom API package for implementing Business Rules and supporting TAPI
    Recreated Package KCS/ KCS_TNR_CAPI, preserving only the Revision History.
    HSU_CAPF.add_tags_er_av
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    HSU_CAPF.create_specification
    HSU_CAPF.create_c_tabalias
    HSU_CAPF.create_c_tabalias_all
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    Activity aborted with ORACLE internal errors.
    -6502 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    What can I do about it???
    Thanks in advance.
    Menno Hoogsteen

    Working on the same project as Menno, I had the time to look into the problem.
    The problem is caused by the creation of the capi-function agregate_char_value in the packages hsu_capf. While creating this function the following code is executed:
    add(' -- allowable values:');
    add(' -- '||l_col_name_list);
    This last statement causes the problem because this table is very big. L_col_name_list contains 2391 characters wich is 393 characters to long. So i changed this code into:
    add(' -- allowable values:');
    add(' -- '||substr(l_col_name_list,1,1990));
    add(' -- '||substr(l_col_name_list,1990));
    and everything works fine. Perhaps something for a patch?
    Kind regards,
    Ruben Spekle

  • 6502 = ORA-06502: PL/SQL: numeric or value error: character string buffer

    i'm getting this error when i try to do the following
    6502 = ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    declare
    str1Query varchar2(32767);
    str2Query varchar2(32767);
    str3Query varchar2(32767);
    str31Query varchar2(32767);
    str32Query varchar2(32767);
    str4Query varchar2(32767);
    desc_t dbms_sql.desc_tab2;
    l_col_cnt integer;
    colvalue varchar(32676);
    cur_rows number;
    repCursor integer;
    begin
    repCursor := dbms_sql.open_cursor;
    dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
    dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
    DBMS_SQL.CLOSE_CURSOR (repCursor);
    end;
    if there is any ideas about what is wrong

    That is not the PL/SQL block that you have run to get that error, right?
    What are the sizes of the individual variables - str1Query, str2Query etc...
    Whay are there so many variables joined together?
    That posted code cannot generate the error you posted:
    SQL> declare
      2
      3  str1Query varchar2(32767);
      4  str2Query varchar2(32767);
      5  str3Query varchar2(32767);
      6  str31Query varchar2(32767);
      7  str32Query varchar2(32767);
      8  str4Query varchar2(32767);
      9  desc_t dbms_sql.desc_tab2;
    10  l_col_cnt integer;
    11  colvalue varchar(32676);
    12  cur_rows number;
    13  repCursor integer;
    14
    15  begin
    16
    17  repCursor := dbms_sql.open_cursor;
    18  dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
    19  dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
    20  DBMS_SQL.CLOSE_CURSOR (repCursor);
    21  end;
    22  /
    declare
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 826
    ORA-06512: at "SYS.DBMS_SQL", line 39
    ORA-06512: at line 18
    SQL>

  • Procedure varchar2 parameter size limit? ORA-6502 Numeric or value error

    Hi ALL,
    I am trying to create out parameters in a Procedure. This procedure will be called by 4 other Procedures.
    PROCEDURE create_serv_conf_attn_cc_email
    ( v_pdf_or_text varchar2,
    v_trip_number number ,
    v_display_attn_for_allmodes out varchar2,
    v_display_cc_for_allmodes out varchar2,
    v_multi_email_addresses out varchar2,
    v_multi_copy_email_addresses out varchar2
    When I call that procedure in another Procedure I am getting following error, which is caused by one of the out parameter being more than 255 characters.
    I found that out via dbms_output.put_line(ing) one of the out parameter as I increased its size.
    ORA-06502: PL/SQL: numeric or value error
    I thought there was no size limit on any parameters passed to a Procedure.
    Any one know of this limit of 255 characters on varchar2 Procedure parameters? Is there a work around keeping the same logic?
    If not I will have to take those parameters out and resort to some global varchar2s which I do not like.
    Thanks,
    Suresh Bhat

    I assume one of the variables you have declared is not large enough for it's assignment.
    Here's an example.
    ME_XE?create or replace procedure test_size(plarge in out varchar2 )
      2  is
      3  begin
      4     plarge := rpad('a', 32000, 'a');
      5  end;
      6  /
    SP2-0804: Procedure created with compilation warnings
    Elapsed: 00:00:00.03
    ME_XE?
    ME_XE?declare
      2     my_var   varchar2(32767);
      3  begin
      4     test_size(my_var);
      5     dbms_output.put_line(length(my_var));
      6  end;
      7  /
    32000
    PL/SQL procedure successfully completed.
    --NOTE here how the declared variable is 500 characters, but the procedure will try to assign it over 32,000 characters...no dice
    Elapsed: 00:00:00.00
    ME_XE?
    ME_XE?declare
      2     my_var   varchar2(500);
      3  begin
      4     test_size(my_var);
      5     dbms_output.put_line(length(my_var));
      6  end;
      7  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "TUBBY.TEST_SIZE", line 4
    ORA-06512: at line 4
    Elapsed: 00:00:00.04Edited by: Tubby on Oct 22, 2008 12:47 PM

  • OLAP -- ORA-6502: numeric or value error: character string buffer too small

    Hi all,
    We got installed Oracle 9201. After applying the patch #2761332 (to upgrade up to 9203)
    and interim patch #2897078 (9203 Patch 1) we always get OLAP Catalog invalid.
    I've tried to mend this problem by doing all it is said in Notes 23268.1 & 226443.1 but
    my effort was worthless. OLAP catalog is still invalid though BI_Checkconfig says is okay at all.
    Nevertheless, we can create dimensions, cubes and measures well, but other problem arises when
    I try to add a dimension to a cube issuing the following command:
    cwm2_olap_cube.add_dimension_to_cube( owner, NAME, owner, DIM_NAME);
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "OLAPSYS.CWM2_OLAP_MANAGER", line 380
    ORA-06512: at "OLAPSYS.CWM2_OLAP_MANAGER", line 397
    ORA-06512: at "OLAPSYS.CWM2_OLAP_CUBE", line 281
    Paying attention to other metalink/otn threads about this subject we found similar problems with
    Oracle 9203 in Japanese (keeping in mind we use Oracle in Spanish).
    Any patch we can apply? Any ideas? Your comments are welcome ...
    Thanks in advanced !!
    [email protected]

    We have fixed the problem !!! :-DDD
    Thanks to all Oracle analysts who replied this issue.
    aLeX
    [email protected]

  • ORA-06502: PL/SQL: numeric or value error While Exporting in Oracle 10g

    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in AR8MSWIN1256 character set and AL16UTF16 NCHAR character set
    server uses AR8ISO8859P6 character set (possible charset conversion)
    About to export the entire database ...
    . exporting tablespace definitions
    . exporting profiles
    . exporting user definitions
    . exporting roles
    . exporting resource costs
    . exporting rollback segment definitions
    . exporting database links
    . exporting sequence numbers
    . exporting directory aliases
    . exporting context namespaces
    . exporting foreign function library names
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions
    . exporting system procedural objects and actions
    . exporting pre-schema procedural objects and actions
    . exporting cluster definitions
    . about to export SYSTEM's tables via Conventional Path ...
    . . exporting table DEF$_AQCALL 0 rows exported
    . . exporting table SRC_RQST_SEQ 1 rows exported
    EXP-00091: Exporting questionable statistics.
    . . exporting table SRC_USERS 6 rows exported
    EXP-00091: Exporting questionable statistics.
    . . exporting table SRC_YEAR_LOOKUP 40 rows exported
    EXP-00091: Exporting questionable statistics.
    . . exporting table TENDER_DETAIL_TABLE 36 rows exported
    EXP-00091: Exporting questionable statistics.
    . . exporting table TENDER_MASTER_TABLE 34 rows exported
    EXP-00091: Exporting questionable statistics.
    . . exporting table TENDER_NEW_DETAIL_TABLE 4 rows exported
    EXP-00091: Exporting questionable statistics.
    . exporting synonyms
    . exporting views
    EXP-00056: ORACLE error 6502 encountered
    ORA-06502: PL/SQL: numeric or value error
    LPX-00210: expected '<' instead of 'n'
    ORA-06512: at "SYS.UTL_XML", line 152
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 7195
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 9135
    ORA-06512: at "SYS.DBMS_METADATA", line 1882
    ORA-06512: at "SYS.DBMS_METADATA", line 3707
    ORA-06512: at "SYS.DBMS_METADATA", line 3689
    ORA-06512: at line 1
    EXP-00056: ORACLE error 6502 encountered
    ORA-06502: PL/SQL: numeric or value error
    LPX-00210: expected '<' instead of 'n'
    ORA-06512: at "SYS.UTL_XML", line 152
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 7195
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 9135
    ORA-06512: at "SYS.DBMS_METADATA", line 1882
    ORA-06512: at "SYS.DBMS_METADATA", line 3707
    ORA-06512: at "SYS.DBMS_METADATA", line 3689
    ORA-06512: at line 1
    EXP-00000: Export terminated unsuccessfully
    Plz reply me the appropriate Solution
    Edited by: user8920919 on May 3, 2010 12:27 AM

    hi,
    EXP-00091: Exporting questionable statistics The client character set(NLS_LANG) does not match the server character;
    select parameter,value from nls_database_parameters where parameter like '%CHARACTERSET%';
    and check the client system character set
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

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

    HI All,
    I am facing the following issue and looking forward for help to find the cause.
    We are converting PDF documents in our repository to HTML using Oracle API
    ctx_doc.ifilter (v_datablob, v_dataclob);
    a highly simplified version of our code will be something like this..
    1) Create table to store the BLOB(Binary PDF documents)
    create table tbl_pdf_store(pdf_doc blob);
    2) Insert a row and store a PDF.
    3) Convert the PDF into HTML and store it in a CLOB object..
    DECLARE
    v_datablob BLOB;
    v_dataclob CLOB;
    BEGIN
    --Create temporary clob objects
    DBMS_LOB.createtemporary (v_dataclob, TRUE, DBMS_LOB.SESSION);
    DBMS_LOB.createtemporary (v_datablob, TRUE, DBMS_LOB.SESSION);
    --get the pdf to be converted from store table
    SELECT pdf_doc
    INTO v_datablob
    FROM tbl_pdf_store
    WHERE rownum < 1;
         --convert the BLOB to HTML and store it in CLOB
         ctx_doc.ifilter (v_datablob, v_dataclob);
    exception
         when others then
         dbms_output.put_line(sqlerrm||' - '||sqlcode);
    end;
    Now the issue I am facing is, the above code works fine for few documents and for few others I get this cryptic error message
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "CTXSYS.DRUE", line 180
    ORA-06512: at "CTXSYS.CTX_DOC", line 1142
    ORA-06502: PL/SQL: numeric or value error - -6502
    I cant reproduce the exact code here, but if anyone had faced the similar issue, then it would be great if they help me out.
    thanks,
    Prashant

    > Billy, its not just plain wrong its a sin :). "When
    others" should itself be avoided if possible(it just
    shows you don't know what error can occur). In the
    actual code, we are using separate package to handle
    and log errors. Here it was just for simplification I
    added that putline code.
    Phew.. You had me worried there... :-)
    > I ran my procedure in debug mode and it throws this
    exception when its executing the Oracle API
    ctx_doc.ifilter
    And there is very little you can do debugging that, as that source code is encoded (wrapped).
    Which means that unfortunately you have to treat that code as a black box and investigate the bug with respects to:
    a) the "environment" from which the call is made (ito of session settings, the sequence of calls made, etc)
    b) the data and parameters passed
    > this is not the case with all the PDFs..I was able to
    convert more than 11 thousand documents without any
    issues. I have this for only few hundred documents.
    This would seem to point to a bug in Oracle's CTX conversion/filter code. Maybe those PDFs are a newer version and is not correctly supported. Maybe they're an older version that is not supported.
    Which is why I said you need to isolate the error. Determine which PDFs are failing. Create a test harness (simplified code as you've posted) to perform a conversion (and nothing else).
    Determine which PDFs fail and which works. Look at the differences between PDFs. E.g. can those problem PDFs be opened with different Acrobat Reader version - or do some of them fail?
    > Another issue is I cannot view the content of the
    these documents to check if anything is different :(.
    You can with Acrobat Reader.. right?
    > so no sure how to go from here...is there a
    printstack method in Oracle 9i(similar to 10g I
    guess) which can give me more information as I am
    currently lost and not sure where to look.
    Dumping the stack will not be of much help. In fact, the error message sequence you pasted already show the call sequence. And as these are in Oracle PL/SQL code, there is nothing really you can do about it.
    My suggestion is to
    a) isolate the error
    b) consult the manual(s) to ensure that the Oracle PL/SQL s/w is used correctly
    c) determine if this is data related (e.g. different PDF versions for example)
    d) log a SR (Service Request) with Oracle Support
    The more you can do ito of (a) - (c), the better the chance for finding the root cause, and the quicker resolution when you have no choice but to do (d).

  • Difficulty in resolving ORA-06502: PL/SQL: numeric or value error:

    Hi
    I am having great difficulty to resolve the following error - ORA-06502: PL/SQL: numeric or value error: character string buffer too small . In my Oracle Package, I have a Function that returns a varchar(255).
    My Function is basically as follows:
    FUNCTION GetUserDept (DeptNum IN NUMBER) RETURN VARCHAR2
    IS
    deptname varchar(255);
    BEGIN
    SELECT name INTO deptname
    FROM depts
    where id = DeptNum;
    RETURN deptname
    END;
    The SQL is running correctly and returns one result, which is what I want. However, when I call the function in my .NET C# code, this is when I am seeing the error message.
    In my code, I said that the commandtype is a stored procedure, passed the parameters, and add it to to the parameters, with the return type and direction put first and executed as a scalar. The code executes, and then fails at the ExecuteScalar line, and it is at this point on my exception handler that I see the error message ORA-6502.
    This really odd, because I have two other functions that return numbers, and I have executed them in the same way, and theses works!
    I have checked my function and can't see what is wrong, and I have tried changing the return type from varchar2 to NVarchar on the return type, but this made no difference.
    This problem has really dogged me for hours and I cannot see how to resolve it.
    Can someone, please help me?

    user633278 wrote:
    This really odd, because I have two other functions that return numbers, and I have executed them in the same way, and theses works!It is that very reason that your code fails. You need to declare the return variable as a string.
    SQL?create or replace
    FUNCTION GetUserDept (DeptNum IN NUMBER) RETURN VARCHAR2
    IS
    deptname varchar(255);
    BEGIN
      RETURN 'hello world';
    END;
      2    3    4    5    6    7    8    9   10 
    Function created.
    SQL?
    SQL?
    declare
      x number;
    begin
      x := GetUserDept(100);
    end;
    SQL?  2    3    4    5    6  declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 4
    SQL?
    SQL?
    declare
      x varchar2(255);
    begin
      x := GetUserDept(100);
    end;
    SQL?  2    3    4    5    6 
    PL/SQL procedure successfully completed.

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

    I get this error on two function activities in a workflow of mine. I don't even get into the pl/sql procedure call.
    The exact error is:
    Error Name -6502
    Error Message: ORA-0605: PL/SQL: numeric or value error: character string buffer too small
    Error Stack: @#@Wf_Engine_Util.Function_Call(MY_PACKAGE.MY_PROC, ITEM_TYPE, ITEM_KEY, 6519, RUN)
    If I retry the step (expedite -> retry) it runs until it hits the second function which does the same thing (there is a function in between the two functions that do not have any issues). I then have to retry that step as well. Any ideas?
    This seems similar to the following issue that does not have a resolution posted:
    ORA-06502 PL/SQL numeric or value error in wf process
    I've tried commenting out the bodies of the procedures called but that does not help (again -- im not getting into the bodies but im not sure what else it could be).
    Any ideas or suggestions?

    Hi,
    Does this happen on every instance of the process, or just a few?
    Are these activities in the middle, or right at the start of the flow?
    Are any other activities being performed correctly first? If so, are these standard or bespoke?
    My inclination would be that there is some kind of variable that is being populated (or concatenated onto), which is growing too big. When the process errors, it gets cleared, which is why an expedite would move the activity on.
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

Maybe you are looking for

  • Multiple users on multiple macs sharing iPhoto Library

    How can different family members (using personal logins) all access the same iPhoto library, regardless of which of our two iMacs they happen to be logged into? I thought the solution would be as simple as: Plug an external hard drive into the Airpor

  • How many files can the Finder move at a time between folders?

    I have about 45000 files to move from one folder to another. Trying to do it in one jump by highlighting them all and trying to drag them froze the Finder. What would be the maximum in a single jump?

  • Jsp:root not working

    I have the page below where I am trying to follow the jspx way(this file has a jsp extension but I hear that is okay too). the page works in firefox, but nothing shows up in IE. Upon further investigation, I select show source in IE and it shows me t

  • Installing saved files from a hard drive on to a new mac!

    My Mac Book Pro suffered damage and has been replaced. Everything had been saved via Time Machine on an external hard drive. This question may seem silly but before sinking it all across, do I have to re-install my programs such as Final Express or i

  • Airport express only music streaming

    Good morning, I just want to you use airport express for streaming music conneting a receiver and my mac pro book. I don´t wanna go into the internet. What to do? I´m using a fritzbox 3270 for internet, phone, etc. Thanks in advance. Michael