ORA-06502 use TO_NUMBER and TO_CHAR

Hi,
Oracle Database 10g 10.2.0.5.0.
I have mistake in this code:
nSuper_ NUMBER(6,2);
dbms_output.put_line('Super: ' ||  TO_NUMBER(nSuper_,'FM9G990D90'));
...I should use "TO_CHAR"...but my test is not failure, why?:
--a)
SET SERVEROUTPUT ON
DECLARE
  nSuper_ NUMBER(6,2);
BEGIN
  nSuper_ := 666.12;
  dbms_output.put_line('Super: ' ||  TO_NUMBER(nSuper_,'FM9G990D90'));
END;
Super: 666,12
--b)
SET SERVEROUTPUT ON
DECLARE
  nSuper_ NUMBER(6,2);
BEGIN
  nSuper_ := 6666.12;
  dbms_output.put_line('Super: ' ||  TO_NUMBER(nSuper_,'FM9G990D90'));
END;
DECLARE
ERROR en línea 1:
ORA-06502: PL/SQL: error  numérico o de valor
ORA-06512: en línea 5
--c)
SET SERVEROUTPUT ON
DECLARE
  nSuper_ NUMBER(6,2);
BEGIN
  nSuper_ := 6666.12;
  dbms_output.put_line('Super: ' ||  TO_CHAR(nSuper_,'FM9G990D90'));
END;
Super: 6.666,12Why "a" not fail and "b" if it fails?

Hi,
jortri wrote:
Why "a" not fail and "b" if it fails?Because Oracle RDBMS is (too) kind to you for "simple" conversion like that (but that doesn't mean you won't get errors...).
The to_number function takes as input <b>string</b>.
You're sending to it a <b>number</b>, so Oracle does this : +"Ok this guy is sending a number into a TO_NUMBER function when it should be a string, let's do an implicit conversion for him transparently"+.
Your to_number(my_number_variable,'FM9G990D90') actually becomes this :to_number( to_char(my_number_variable) ,'FM9G990D90')But, as you can notice, the to_char function is not given any format, so it uses your session default which could be way different from the mask you're providing to the to_number function.
Please execute this to understand what your failing to_number function is receiving as input :select 6666.12 number_implicitly_converted from dual;By default, on my machine it displays this :Scott@my11g SQL>select 6666.12 number_implicitly_converted from dual;
NUMBER_IMPLICITLY_CONVERTED
                    6666.12Now if I use it as input of your to_number function with your format mask :Scott@my11g SQL>select TO_NUMBER('6666.12','FM9G990D90') back_to_number from dual;
select TO_NUMBER('6666.12','FM9G990D90') back_to_number from dual
ERROR at line 1:
ORA-01722: invalid numberTadammm !
Conclusion : Don't mess up the use of to_number/to_char/to_date functions.
:-)

Similar Messages

  • Ora-06502:pl/sql and ora-06512 at sys.owa_util errors

    Greetings -
    I have just installed APEX 2.2 in my 9.2.0.7 database and am going through the exercises in the "2 Day+ Application Express Developer's Guide." I was making good progress, until I got to Chapter 5, How to Control Form Layout. I created the script "ht_emp", as instructed. Everything in the script works, except for the "create or replace trigger bi_ht_emp" part. It fails with the following errors:
    ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", lone 328 ORA-06512: at "SYS.HTP", line 862 ORA-06512: at "SYS.HTP", line 977 ORA-06512: at "SYS.HTP", line 995 ORA-06512: at "FLOWS_020200.WWV_FLOW_SW_API", line 428 ORA-01003: no statement parsed. I have confirmed that nls_length_semantics = BYTE
    Any suggestions?
    Thanks in advance - Gail

    Scott -
    Here's the part of the script that chokes --
    CREATE OR REPLACE TRIGGER bi_ht_emp
    BEFORE INSERT ON ht_emp
    FOR EACH ROW
    BEGIN
    SELECT ht_emp_seq.nextval
    INTO :new.emp_id
    FROM DUAL;
    :new.rec_create_date := SYSDATE;
    END;
    Thanks fro helping -
    Gail

  • Ora-06502 using the PKG_LOOK_AND_FEEL.Paint_Block on Linux

    Hi All.
    I have ported an application from development (win - client machine) to the application server on Linux.
    An error (ora-06502) is shown where calling the PKG_LOOK_AND_FEEL.Paint_Block.
    I have verified all parameters have a value when this procedure is called ... Any ideas of what may be causing this one ...?
    Best regards, Luis ....!

    Hello,
    Please, don't ask questions on the LAF project on this forum. Send your questions to the dedicated email : [email protected]
    Thank you,
    Francois

  • Using NVL and to_char

    Hi guys,
    Some help needed here; I'm using the following code to create a report in Oracle APEX 3.0:
    select     "EBA_BT_PROBLEM"."ID" as " BUG ID",
    "EBA_BT_PROBLEM"."SUBJECT" as "SUBJECT",
         "EBA_BT_URGENCY"."URGENCY_NAME" as "PRIORITY",
         "EBA_BT_USER"."LOGIN_NAME" as "ASSIGNED TO",
    "EBA_BT_PROBLEM"."SUBMITTED_BY_ID" as "SUBMITTED BY"
    from     "EBA_BT_PROBLEM" INNER JOIN "EBA_BT_USER" ON "EBA_BT_PROBLEM"."ASSIGNED_TO_ID" = "EBA_BT_USER"."ID"
    JOIN "EBA_BT_URGENCY" ON "EBA_BT_PROBLEM"."URGENCY_ID" = "EBA_BT_URGENCY"."ID"
    JOIN "EBA_BT_STATUS" ON "EBA_BT_PROBLEM"."STATUS_ID"
    = "EBA_BT_STATUS"."ID"
    JOIN "EBA_BT_PRODUCT" ON "EBA_BT_PROBLEM"."PRODUCT_ID"
    = "EBA_BT_PRODUCT"."ID"
    JOIN "EBA_BT_CATEGORY" ON "EBA_BT_PROBLEM"."CATEGORY_ID"
    = "EBA_BT_CATEGORY"."ID"
    where
    to_char("EBA_BT_PROBLEM"."STATUS_ID") = NVL(:P64_STATUS,to_char("EBA_BT_PROBLEM"."STATUS_ID"))
    It is returning all of the fields and data that I am after, the only issue I am having is with my "where". I have a drop down select box called P64_STATUS, which allowes me to chose from several options, which will in turn give me different outputs of the report. It does this ok, but when it is set to the defualt or "null" value, I want to to just give me all of the possible rows from the Select; instead it gives me nothing back.
    So in essence I need to correct the code in my where clause, I think mainly here:
    NVL(:P64_STATUS,to_char(*"EBA_BT_PROBLEM"."STATUS_ID"*))
    in order to give me what I am after
    I've tried to explain what I am after as best I can, any help would be much appreciated; thanks!

    Hi,
    Sean Ed wrote:
    It is returning all of the fields and data that I am after, the only issue I am having is with my "where". I have a drop down select box called P64_STATUS, which allowes me to chose from several options, which will in turn give me different outputs of the report. It does this ok, but when it is set to the defualt or "null" value, I want to to just give me all of the possible rows from the Select; instead it gives me nothing back.I suspect that :p64_status is getting set to a space, or something else that you can't see, rather than to NULL. Run this to check:
    SELECT  DUMP (:p64_status)
    FROM    dual;and post the output.
    If that's the problem, use TRIM to equate a string that consists of nothing but spaces with NULL:
    WHERE     (         :p64_status  = TO_CHAR (eba_bt_problem.status_id)
         OR  TRIM (:p64_status)      IS NULL
         )The way you were using NVL seems to assume that STATUS_ID can't be NULL. Is that the case?
    This has nothing to do with your current question, but why are you using TO_CHAR? Is status_id a NUMBER, but you can only supply VARCHAR2 parameters?
    If so, it would be more efficient to convert :p64_status to a NUMBER (which only means one call to TO_NUMBER for the entire query), rather than convert status_id to a VARCHAR2 (which requires calling TO_CHAR on every row). So you might consider this:
    WHERE     ( TO_NUMBER (:p64_status)  = eba_bt_problem.status_id
         OR     TRIM (:p64_status)  IS NULL
    I've tried to explain what I am after as best I can, any help would be much appreciated; thanks!The explanation was good, but there's a limit to how much explanations can do. It would really help if you included a test case that people can run to re-create the problem and test their solutions. That includes CREATE TABLE and INSERT statements for some sample data, VARIABLE and assignment statements for parameters (such as :p64_status), and the results you want from that data with the given parameter(s).
    It's good that you mentioned you're using Apex 3.0; always say what version of the database (e.g., 10.2.0.4.0) you're using, too.

  • ORA-06502 during a procedure which uses Bulk collect feature and nested tab

    Hello Friends,
    have created one procedure which uses Bulk collect and nested table to hold the bulk data. This procedure was using one cursor and a nested table with the same type as the cursor to hold data fetched from cursor. Bulk collection technique was used to collect data from cursor to nested table. But it is giving ORA-06502 error.
    I reduced code of procedure to following to trace the error point. But still error is comming. Please help us to find the cause and solve it.
    Script which is giving error:
    declare
    v_Errorflag BINARY_INTEGER;
    v_flag number := 1;
    CURSOR cur_terminal_info Is
    SELECT distinct
    'a' SettlementType
    FROM
    dual;
    TYPE typ_cur_terminal IS TABLE OF cur_terminal_info%ROWTYPE;
    Tab_Terminal_info typ_cur_Terminal;
    BEGIN
    v_Errorflag := 2;
    OPEN cur_terminal_info;
    LOOP
    v_Errorflag := 4;
    FETCH cur_terminal_info BULK COLLECT INTO tab_terminal_info LIMIT 300;
    EXIT WHEN cur_terminal_info%rowcount &lt;= 0;
    v_Errorflag := 5;
    FOR Y IN Tab_Terminal_Info.FIRST..tab_terminal_info.LAST
    LOOP
    dbms_output.put_line(v_flag);
    v_flag := v_flag + 1;
    end loop;
    END LOOP;
    v_Errorflag := 13;
    COMMIT;
    END;
    I have updated script as following to change datatype as varchar2 for nested table, but still same error is
    comming..
    declare
    v_Errorflag BINARY_INTEGER;
    v_flag number := 1;
    CURSOR cur_terminal_info Is
    SELECT distinct
    'a' SettlementType
    FROM
    dual;
    TYPE typ_cur_terminal IS TABLE OF varchar2(50);
    Tab_Terminal_info typ_cur_Terminal;
    BEGIN
    v_Errorflag := 2;
    OPEN cur_terminal_info;
    LOOP
    v_Errorflag := 4;
    FETCH cur_terminal_info BULK COLLECT INTO tab_terminal_info LIMIT 300;
    EXIT WHEN cur_terminal_info%rowcount &lt;= 0;
    v_Errorflag := 5;
    FOR Y IN Tab_Terminal_Info.FIRST..tab_terminal_info.LAST
    LOOP
    dbms_output.put_line(v_flag);
    v_flag := v_flag + 1;
    end loop;
    END LOOP;
    v_Errorflag := 13;
    COMMIT;
    I could not find the exact reason of error.
    Please help us to solve this error.
    Thanks and Regards..
    Dipali..

    Hello Friends,
    I got the solution.. :)
    I did one mistake in procedure where the loop should end.
    I used the statemetn: EXIT WHEN cur_terminal_info%rowcount &lt;= 0;
    But it should be: EXIT WHEN Tab_Terminal_Info.COUNT &lt;= 0;
    Now my script is working fine.. :)
    Thanks and Regards,
    Dipali..

  • ORA-06502 When using MAX(Column) with %TYPE

    Hi Guys,
    Just had this discussion on the main database forums, and the problem was somewhat resolved. But they did ask me to check here if this was a known issue.
    Assuming I have a table defined as follows
    CREATE TABLE TEST_TABLE (TEST_COLUMN CHAR(8 BYTE)) ;and the table only has a single record NZ07100S
    We also define a function as
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;We ran the following command
    SELECT GETTESTVALUE FROM DUAL;and receive an error as follows
    Error report:
    SQL Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "GETTESTVALUE", line 6
    06502. 00000 - "PL/SQL: numeric or value error%s"However, if were to modify the function to the following
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT TEST_COLUMN INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;There is no error reported and the value NZ07100S is returned.
    Of course, when we modified the function to be
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT CAST(MAX(TEST_COLUMN) AS CHAR(8))INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;No errors are reported, and the value is returned
    Some of the guys in the main forums tried this out on Enterprise edition and did not encounter any issues. To faciliate their testing, I spooled the sqlsplus output and it is as follows
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> create table test_table (test_column char(8 byte));
    Table created.
    SQL> insert into test_table
      2       values ('NZ07100S');
    1 row created.
    SQL> commit
      2  /
    Commit complete.
    SQL> create or replace function gettestvalue
      2      return test_table.test_column%type
      3  is
      4     test_value   test_table.test_column%type;
      5  begin
      6     select max(test_column) into test_value from test_table;
      7  return test_value;
      8  end;
      9  /
    Function created.
    SQL> select gettestvalue from dual
      2  /
    select gettestvalue from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "JEGA.GETTESTVALUE", line 6
    SQL> spool offAt the request of one of the posters, the following was also executed.
    SQL> select lengthb (TEST_COLUMN)
      2  from test_table
      3  where test_column = 'NZ07100S'
      4  /
    LENGTHB(TEST_COLUMN)
                       8
    SQL> select max (lengthb (test_column))
      2  from test_table
      3  /
    MAX(LENGTHB(TEST_COLUMN))
                            8The eventual solution that made this piece of code work on XE was as follows
    SQL> alter table test_table modify test_column varchar2 (8 byte);
    Table altered.
    SQL> select gettestvalue from dual;
    GETTESTVALUE
    NZ07100S
    SQL> spool off;Now, I can't change the production (Enterprise Edition) schema. The XE is being used by the developers for their local testing. As such, knowing that the problem does not occur on Enterprise, I can ask them to make the changes locally to their XE for their local testing.
    However, I was just wondering, does anyone know if this is a known issue with Oracle XE ??
    Thanks and regards
    Jega

    Hi Jega,
    thank you for your post.
    Don't know is this issue XE release specific issue or 10.2.0.1 generally?
    Anyway, already 10.2.0.3 is patched - as you can see, even selecting from XE through PE102030 working OK:
    SQL> select * from v$version;
    BANNER
    Personal Oracle Database 10g Release 10.2.0.3.0 - Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> CREATE TABLE TEST_TABLE (TEST_COLUMN CHAR(8 BYTE)) ;
    Table created.
    SQL> CREATE OR REPLACE FUNCTION gettestvalue
      2  RETURN TEST_TABLE.TEST_COLUMN%TYPE
      3  IS
      4  TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
      5  BEGIN
      6  SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM TEST_TABLE;
      7  RETURN TEST_VALUE;
      8  END;
      9  /
    Function created.
    SQL> insert into test_table
      2   values ('NZ07100S');
    1 row created.
    SQL> SELECT GETTESTVALUE FROM DUAL;
    GETTESTVALUE
    NZ07100S
    SQL> CREATE OR REPLACE FUNCTION gettestvalue_from_xe
      2  RETURN TEST_TABLE.TEST_COLUMN%TYPE
      3  IS
      4  TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
      5  BEGIN
      6  SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM HR.TEST_TABLE@XE_LINK;
      7  RETURN TEST_VALUE;
      8  END;
      9  /
      Function created.
    SQL> SELECT GETTESTVALUE_FROM_XE FROM DUAL;
    GETTESTVALUE_FROM_XE
    NZ07100S
    SQL> conn hr/hr_password@xe
    Connected.
    SQL>  SELECT GETTESTVALUE FROM DUAL;
    SELECT GETTESTVALUE FROM DUAL
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "HR.GETTESTVALUE", line 7
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>Note: XE_LINK is database link pointing from my PE instance to XE instance.

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

  • Error ORA-06502 When using function REPLACE in PL/SQL

    Hi,
    I have a PL/SQL procedure which gives error 'Error ORA-06502 When using function REPLACE in PL/SQL' when the string value is quite long (I noticed this with a string 9K in length)
    variable var_a is of type CLOB
    and the assignment statement where it gives the error is
    var_a := REPLACE(var_a, '^', ''',''');
    Can anyone please help!
    Thanks

    Even then that shouldn't do so:
    SQL> select overload, position, argument_name, data_type, in_out
      2  from all_arguments
      3  where package_name = 'STANDARD'
      4  and object_name = 'LPAD'
      5  order by 1,2
      6  /
    OVERLOAD   POSITION ARGUMENT_NAME                  DATA_TYPE                      IN_OUT
    1                 0                                VARCHAR2                       OUT
    1                 1 STR1                           VARCHAR2                       IN
    1                 2 LEN                            BINARY_INTEGER                 IN
    1                 3 PAD                            VARCHAR2                       IN
    2                 0                                VARCHAR2                       OUT
    2                 1 STR1                           VARCHAR2                       IN
    2                 2 LEN                            BINARY_INTEGER                 IN
    3                 0                                CLOB                           OUT
    3                 1 STR1                           CLOB                           IN
    3                 2 LEN                            NUMBER                         IN
    3                 3 PAD                            CLOB                           IN
    4                 0                                CLOB                           OUT
    4                 1 STR1                           CLOB                           IN
    4                 2 LEN                            NUMBER                         INI wonder what happened?

  • ORA-06502: PL/SQL error with dimensions and roles

    Hi everyone,
    When executing a mapping that loads a cube we are always getting that ORA-06502: PL/SQL error character string buffer too small
    The cube contains a number of dimensions, some of them with roles. We've checked that the error appears when we use two different lookup operators to fill dimension atributtes in the cube and its correspondent role. If we map dimension attributes with lookup operator, and the role attributes with constants, the mapping executes without any error. Moreover, even thought it doesnt make any sense, if we map the role dimension attributes with a lookup operator linked to a different dimension, it works too.
    We think that this could be due to attributes names, maybe they are too long, but we have tried to make them shorter and still getting the same error.
    Any ideas of what could be happening?
    Thank you so much in advance.

    The return datatype in a PLSQL function is unconstrained. Which means it does not have a size.
    The size is declared on the receiving end.
    What size variable are you trying to return your value into?
    Here is an example...
    SQL>create or replace function my_func
      2  return varchar2
      3  is
      4  begin
      5    return USER;
      6  end;
      7  /
    Function created.
    SQL>declare
      2    my_string varchar2(30);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL>declare
      2    my_string varchar2(3);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 4

  • XML transform and ORA-06502:

    When i update a limited set ( 1 row) of data with the statement in example 1 the statement works fine. When i delete the where clause i get ORA-06502: numeric or value error: character string buffer too small.
    How can i make the statement work for a large amount of data.
    example 1:
    update udo.udo_cursus_beschrijvingen cbg
    SET cbg.tekst = cbg.tekst.transform(XMLType(
    '<?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="url[(starts-with(child::text(),''www.''))]">
    <url>http://<xsl:value-of select="."/></url>
    </xsl:template>
    <xsl:template match="@*|*|text()|processing-instruction()">
    <xsl:copy>
    <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    ')).getStringVal()
    where cbg.id = 1672;

    Sergio - I'm surprised that a hundred rows causes the Display As Text (based on LOV, save/does not save the state) to blow out. I'd expect no problems up to 5000 rows or so. I'd like to see an example of your case. The limitation on select lists is usually related to either the size of an individual report column (4000 max) or the size of a report row (32K max) in which a select-list lov is used. The total size of the HTML returned counts towards these limits. The problem for select-list items on a page is that large select lists mean lots of HTML on the page making the page heavy and burdening the network.
    Scott

  • ORA-06502 and ORA-06503 if more than 3700 rows

    In a simple application one of the two tables has about 10.000 rows. If I limit the "Max Row Count" to 3700 the "select list" will be generated without error
    ("row(s) 1-17 of more than 3700").
    With "Max Row Count" 3710 and 3720 an ORA-06502, with "Max Row Count" 3730 an ORA-06503 occur and no select list will appear.
    Other values greater 3710 e.g. 4000 don't cause any Oracle error but no select list was built.
    It seems to be that the value limit will be exeeded in cases where the row count is greater than 3700.

    Joachim,
    Select lists are limited to 32,000 characters. This includes the select and option tags and all the display and return values. Depending on your pagination settings, specifically on the number of rows you display on each page, this translates into around 4000 rows being supported by this particular pagination style. If you have more rows then that, I'd recommend using a different pagination style, one that does not show a select list.
    Regards,
    Marc

  • Help - I'm getting errors ORA-06502:and ORA-01002: at runtime

    Help
    I am getting the following errors at runtime and need some isdeas on what to check:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "OWB_RUNTIME.WB_RT_MAPAUDIT", line 1736
    ORA-06512: at "OWB_RUNTIME.WB_RT_MAPAUDIT", line 2625
    ORA-06512: at "OWB_TARGET.MAP_BSL_PLACEMENT_FACT2B", line 1148
    ORA-01002: fetch out of sequence
    ORA-02063: preceding line from BASIL@LOC_TARGET_NEW_LOC_BASIL_SOURC
    ORA-06512: at "OWB_TARGET.MAP_BSL_PLACEMENT_FACT2B", line 1457
    ORA-06512: at "OWB_TARGET.MAP_BSL_PLACEMENT_FACT2B", line 3458
    ORA-06512: at line 1
    My Mapping is a fact recording enrolments in courses (located in my main target database - oracle 9i)
    joining with an equi-join to a table that contains an audit of all changes to the enrolment (in my source database - Sybase 12.5)
    then updating two fields in a tabke that is a second definition of the first fact
    The equi join uses the key to the enrolment table, plus a transaction type to identify only the creation of the record
    Between the join and the update of the table one field is going thru a trim (converting char to varchar2) then an expression that sets the value to "not_supplied" for cases where the value was null.
    The other field is a date (from sybase datetime to oracle Date)
    (they are the user that created the enrolment and the date the enrolment was actioned)
    I created this mapping by copying another mapping that does pretty much the same thing, deleting the join and table it was joining to and adding the audit table and new join.
    Both mapping deploy fine with no warnings, the original executes fine the variation gives the errors above.
    I have tried removing one then the other of the columns I am updating. (the same errors occur)
    I am about to re-write the mapping from scratch, but can anyone guess what is wrong with it ? (I'm using OWB 9.2.0.2.8)

    Thanks for the suggestion
    There are no "char(32767)"s in the package - altho there are "varchar2(32767)"s
    I have tried a variotion on the script, outputting the result to a new table instead of updating the enrolment - which ran fine so the error is in the update.
    I tried adding a step using the result in the temp table to update the enrolment table - and got my errors again. So there is something funny in my data. Nothing obvious shows.
    The full temp table contains 745292 records - when it failed 150 records had been written.
    I note that although I had expected only to find one record per enrolment, there are some where there are two (@#$%!! source system writing two "insert" audit records) - could my problem be that I am updating a record previously updated - where do I set the script to commit as it goes?
    Sandra

  • ORA-20001 and ORA-06502

    Hi all,
    after 6 months, my production application starts to show the same error on the report:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    The error occurs in the same type of page (form based on a table where i added a report with details) and if i change the column with Display As LOV (not save the state) with standard Report Column all works fine and if change again to Display As LOV (not save the state) dosn't work.
    At the moment i changed all query of the report to don't use the Display As LOV (not save the state) in the report, but why the application now get this error?
    Thanks,
    Sergio

    Sergio - I'm surprised that a hundred rows causes the Display As Text (based on LOV, save/does not save the state) to blow out. I'd expect no problems up to 5000 rows or so. I'd like to see an example of your case. The limitation on select lists is usually related to either the size of an individual report column (4000 max) or the size of a report row (32K max) in which a select-list lov is used. The total size of the HTML returned counts towards these limits. The problem for select-list items on a page is that large select lists mean lots of HTML on the page making the page heavy and burdening the network.
    Scott

  • Probe:S:get_scalar: exception 10: ORA-06502: And system is very sloq

    Hi all,
    We r using Oracle 9i (9.2.0.6.0) on AIX 5.2
    I am getting following error on Trace file. And I am unable to locate the accurate package, function or procedure which causes this error.
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error
    ORA-06553: PLS-:
    ORA-06553: PLS-:
    ORA-06553: PLS-103: Encountered the symbol "_" when expecting one of the following:
    begin case declare exit for function goto if loop mod null
    package pragma procedure raise return select separate type
    update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    form table call close current define delete fetch lock insert
    open rollback savepoint set
    ORA-06553: PLS-103: Encoun
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Probe:S:get_scalar: exception 10: ORA-06502: PL/SQL: numeric or value error: character to number conversion error

    just out of interest, what output do you get if you desc user_source?
    I get:
    NAME                                               VARCHAR2(30)               
    TYPE                                               VARCHAR2(12)               
    LINE                                               NUMBER                     
    TEXT                                               VARCHAR2(4000)        

  • 4.0 ORA-06502 and ORA-01722 in different languages

    Hi!
    After 4.0 installation on my XE-database there are some errors - dependig on which language is actual.
    german language is actual:
    home > administration > dashboard:
    every report results ORA-01722
    english language is actual:
    home:
    report about top applications results
    ORA-06502: PL/SQL: numeric or value error ORA-06512: at "APEX_040000.WWV_FLOW_4000_UI", line 731 ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Is there any idea about what is wrong?
    Kind regards,
    Andrea

    Hi Andrea,
    I see similar errors on my instance. I updated to 4.0.1 and saw some of them disappear, but a few of them are still there. Even reinstalling 4.0.1 from scratch did not change anything about this.
    Apparently the de-translation has some gaps, e.g. the title for the worspace administration is
    "Workspace &COMPANY verwalten." where &COMPANY should be the workspacename, or the confirmation message when deleting an application, which says "Anwendung &F4000_P20_FLOW_ID wurde gelöscht.". Both messages appear with the correct substitution value as soon as I switch the language to English.
    What made me wonder at first wass that both dashboards for "Top Applications" and "Top Users" worked in German, but threw erros in the English version. Without changing anything in my system they "started" working later, so I guess there was a problem with the proper initialization for those reports.
    I still have a complete set of ORA-01722 in the German version of the activity dashboard, which works better in English:
    Top Users, Top Applications and Top Pages say "Report contains no data", which is better than ORA-01722. Recent Logins shows correct results, Recent errors gives me the 01722-errors I produced before.
    Does anyone else have these problems? Or does anyone have a solution for them?

Maybe you are looking for

  • Itunes install/uninstall

    I was trying to download the latest version of itunes, but itunes wouldn't let me. The support folks said to unintall the old version and install the new. I uninstalled the old version, but I still couldn't install the new. I decided to punt so I got

  • Importing Songs from CD

    I am having trouble importing songs from my cd (as title suggests) only 789:57:13 Seconds (which is basically 7 seconds) is importing from each song on all my cds, when songs are generally 3 to 4 mins long... anyone know how to help? I have tried loo

  • Split  alv to 3

    Hi all. I have a screen splited to 2. I would like to split it to 3 - top, middle & bottom. My code is: * Creating Custom Container   IF g_custom_container IS INITIAL.     CREATE OBJECT g_custom_container       EXPORTING         container_name = g_cu

  • DSL ON THE WEEK ENDS

    I am so close to pro-rating my verizon DSL service!!!   Every darn week end for the past month my DSL has been so slow or down its not funny.  Why the heck  am  I paying for the best service (so Verizon says) and noiit receiving it?  This is so darn

  • Blocking row navigation during validation error

    Hi Experts, I'm using jDev 11.1.2.4.0 I'm trying to find the property blockRowNavigationOnError, but it doens't exists on my jDev version. Anyone knows an alternative to this property? What I want to accomplish is:           - the field it's blocked