Ora-1401

CREATE OR REPLACE PACKAGE BODY ERR_PKG
AS
PROCEDURE ERR_PROC
AS
CURSOR C1
IS
    SELECT SEGMENT1 FROM CONV_STG;
CURSOR C2 (P_SEGMENT1 VARCHAR2)
IS
    SELECT MIE.ERROR_MESSAGE,MSII.SEGMENT1 FROM  MTL_SYSTEM_ITEMS_INTERFACE MSII
                 , CONV_STG XMIC
                 , MTL_INTERFACE_ERRORS MIE
     WHERE     XMIC.SEGMENT1 = P_SEGMENT1
          AND  MSII.SEGMENT1 = XMIC.SEGMENT1
          AND  MSII.TRANSACTION_ID=MIE.TRANSACTION_ID;
G_ERROR_MESSAGE VARCHAR2(3000);
BEGIN
FOR I IN C1
LOOP
G_ERROR_MESSAGE:=NULL;
FOR J IN C2 (I.SEGMENT1)
LOOP
G_ERROR_MESSAGE:=G_ERROR_MESSAGE||','||J.ERROR_MESSAGE;
   IF G_ERROR_MESSAGE IS NULL THEN
   UPDATE CONV_STG SET PROCESS_FLAG='S', ERROR_MESSAGE = 'SUCCESS'
    WHERE SEGMENT1 = J.SEGMENT1;
   ELSE
   UPDATE CONV_STG SET PROCESS_FLAG='IE', ERROR_MESSAGE = G_ERROR_MESSAGE
     WHERE SEGMENT1 = J.SEGMENT1;
   END IF;
END LOOP;
END LOOP;
EXCEPTION
   WHEN OTHERS THEN
   DBMS_OUTPUT.PUT_LINE(SQLERRM||' '||'ERROR');
END CONV_ERR_PROC;
END CONV_ERR_PKG;
ERROR:
ORA-01401: inserted value too large for column
could you help me how to resolve it
Thanks & Regards
pallis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

ERROR:
ORA-01401: inserted value too large for columnI find the Error message Self - Explanatory. The value you are trying to Insert/Update, exceeds its length.
What you need to do is, verify the Column attributes using DESC Table_name.
Check the
IF G_ERROR_MESSAGE IS NULL THEN
UPDATE CONV_STG SET PROCESS_FLAG='S', ERROR_MESSAGE = 'SUCCESS'
WHERE SEGMENT1 = J.SEGMENT1;
ELSE
UPDATE CONV_STG SET PROCESS_FLAG='IE', ERROR_MESSAGE = G_ERROR_MESSAGE
WHERE SEGMENT1 = J.SEGMENT1;
END IF;code. Verify if PROCESS_FLAG and ERROR_MESSAGE columns have suitable length.
Check the length of G_ERROR_MESSAGE, if it fits the ERROR_MESSAGE column.
If you can give us the Output of:
DESC Table_name
and the Value of variable G_ERROR_MESSAGE, it would be better.
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM||' '||'ERROR');Seriously think about replacing the code with a proper Exception Handling.

Similar Messages

  • Problem 1 in my person form: hitting ora-1401 (view with check option).

    In an earlier stage I had a table PERSON and a table ENSEMBLE.
    At some stage I decided it was not handy I was storing performing musicians in two different tables.
    So I set up a supertype, CONTRIBUTOR. PERSON is now a view on CONTRIBUTOR.
    The attribute IS_NATURAL_PERSON makes the record listed in person.
    The view definition is
    CREATE OR REPLACE FORCE VIEW "PARTITUREN"."PERSON" ("ID", "FIRST_NAME",
      "MIDDLE_INIT", "LAST_NAME", "GIVEN_NAME", "SORT_KEY", "DISPLAY_VALUE",
      "GENDER", "DATE_OF_BIRTH", "DATE_OF_BIRTH_APPROX", "LOCATION_OF_BIRTH",
      "DECEASED", "DATE_OF_DEATH", "DATE_OF_DEATH_APPROX", "LOCATION_OF_DEATH",
      "NATIONALITY", "ANV_ID", "NUMBERING_SYSTEM", "OPUSNUMBERS", "PORTRAIT",
      "MIME_TYPE", "FILE_NAME", "IS_NATURAL_PERSON", "LWTIMEST", "CREATED_BY",
      "CREATED_TS", "UPDATED_BY", "UPDATED_TS")
    AS
      SELECT
        id,
        first_name,
        middle_init,
        last_name,
        given_name,
        sort_key,
        display_value,
        gender,
        date_of_birth,
        date_of_birth_approx,
        location_of_birth,
        deceased,
        date_of_death,
        date_of_death_approx,
        location_of_death,
        nationality,
        anv_id,
        numbering_system,
        opusnumbers,
        portrait,
        mime_type,
        file_name,
        is_natural_person,
        created_ts lwtimest,
        created_by,
        created_ts,
        updated_by,
        updated_ts
      FROM
        contributor
      WHERE
        is_natural_person='Y'
    WITH CHECK OPTION;When I enter a record in Apex, I have the is_natural_person attribute default to Y.
    However I always hit ora-1401.
    It works in sql*developer and sql*plus.
    I now always have to resort to non-Gui tools to enter someone. This is nasty.
    Oracle 11.2.0.1, Apex 4.0.0.0.46
    Sybrand Bakker
    Senior Oracle DBA

    Hello .
    Some NLS charsets (such as UTF8) require more than one byte to store accented characters like "Ȩ", "ȿ", "�", "�", "ȵ", "ȭ" in the database.
    For example, when a 10 character string is inserted into a varchar2(10) column, the above messages may be signaled if your string contains accentuated characters such as "Ȩ", "ȿ", "�", �", "ȵ", "ȭ". used in languages like German
    One solution
    If the UTF8 NLS charset is being used with French, German ... characters in an Oracle database, then the size of the target column length should be set accordingly.
    Set the NLS_LANGUAGE and NLS_CHARACTERSET database parameters.
    One approach is to change the Database settings as follows:
    ALTER DATABASE CHARACTER SET WE8ISO8859P1;
    SHUTDOWN IMMEDIATE
    Onother
    According to the Oracle documentation, column length semantics determine whether the length of a column is specified in bytes or in characters. You use BYTE to specify that the length is in bytes, and you use CHAR to specify that the length is in characters. CHAR length semantics is also known as codepoint length semantics.
    Because some character sets require more than one byte for each character, a specification of 10 BYTE for a column might actually store less than 10 characters for certain character sets, but a 10 CHAR specification ensures that the column can store 10 characters, regardless of the character set.
    You set the length semantics for an Oracle database using the NLS_LENGTH_SEMANTICS initialization parameter, and all VARCHAR2 and CHAR columns use the setting specified for this initialization parameter as the default. If this initialization parameter is not set, then the default setting is BYTE.
    Edited by: Mortus on Jun 28, 2011 2:57 PM

  • SQL*LOADER ERROR 비교 (ORA-2359, ORA-1401)

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-09
    SQL*LOADER ERROR 비교 (ORA-2359, ORA-1401)
    ==========================================
    PURPOSE
    SQL*LOADER 를 사용하는 경우 ORA-2359 ERROR가 나는 경우와
    ORA-1401 ERROR가 나는 경우를 비교한다.
    Examples
    table 의 desc가 다음과 같다고 가정하자.
    SQL> create table test5(a varchar2(1000));
    이 경우 delimiter 가 comma 인지 position 으로 구분되는지에 따라 error
    message가 달리 나타난다.
    1) ORA-2359 : field in datafile exceeded maximum specified length
    load data
    infile test.dat
    replace
    into table test5
    fields terminated by ','
    (a char) 로 실행 시 발생.
    ---> a char(1000) 으로 하면 error 해결이 가능하다.
    2) ORA-1401: inserted value too large for column
    load data
    infile test.dat
    replace
    into table test5
    fields terminated by ','
    (a position(1:2000) char)
    ---> 이 경우 a position (1:1000) char 로 하면 해결 가능하다 .
    * 참고로 + , - 기호와 comma 를 load 하기 위해서는 decimal external을
    사용한다. (a position decimal external (10))
    Reference Documents
    ---------------------

    You hit Bug 3531336
    Run the script catcio.sql from $ORACLE_HOME/rdbms/admin directory.
    Run this in sys schema.
    And then load the data with sqlloader.

  • ORA-1401: inserted value too large for column

    Some versions (of Oracle 9i) insert a truncated string, newer versions (9.2.0.6.5) issue an error message and don’t insert anything.
    ORA-1401: inserted value too large for column
    We are aware of a 2000-character limit on literal strings (might be a byte limit instead of character) but you could always use concatenation to build up a longer string 2000 at a time. But this is rejected if the field is nvarchar2 and wider than 1000 (characters).
    Using a function, you can insert 2000 characters. For example, lpad(‘X’, 2000, ‘X’) will go in. But this will not:
    ‘XXXXXXXXXXXXXXXXXXXXXXXXXX’
    ||’XXXXXXXXXXXXXXXXXXXXXXXXX’
    . . . to >1000 characters.
    If anyone knows anything about this, we would appreciate hearing from you.

    we had this problem.
    We talked to some oracle person who said some portlets on a page had trouble exporting.
    Sure enough after we deleted all the portlets (one at a time to determine which one was giving us the problem. Turned out none of ours worked) the page exported and imported just fine.
    Hopefully this is being worked on...

  • Problem upload too large file in a Content Area ORA-1401

    Hi All
    I have a customer who is trying to upload a file with a too large name in a content area.
    If the filename is 80 characters, it works fine.
    But if the filename is upper or 80 characters the following error ocurred:
    ORA-01401: inserted value too large for column
    DAD name: portal30
    PROCEDURE : PORTAL30.wwv_add_wizard.edititem
    URL : http://sbastida-us:80/pls/portal30/PORTAL30.wwv_add_wizard.edititem
    I checked the table: WWV_DOCUMENT and it have a column name: FILENAME is defined like VARCHAR2(350).
    If i run a query on this table, the filename column stores the filename of the file uploaded.
    Is this a new bug? may i fill this bug?
    Do you have any idea about this issue?
    Thanks in advance,
    Catalina

    Catalina,
    The following restrictions apply to the names of documents that you are uploading into the repository:
    Filenames must be 80 characters or less.
    Filenames must not include any of these characters: \ / : * ? < > | " % # +
    Filenames can include spaces and any of these characters: ! @ ~ & . $ ^ ( ) - _ ` ' [ ] { } ; =
    Regards,
    Jerry
    null

  • Exporting Page fails with ORA-1401 inserted value too large for column

    Hi Everyone,
    I have a client what is getting the following error when
    attempting to export a page using pageexp.cmd. A simple page
    works for them but there main page does not. Here is the error:
    Extracting Portal Page Data for Export...
    begin
    ERROR at line 1:
    ORA-01401: inserted value too large for column
    ORA-06512: at "PORTAL30.WWUTL_POB_EXPORT", line 660
    ORA-06512: at "PORTAL30.WWUTL_POB_EXPORT", line 889
    ORA-06512: at line 5
    Has anyone seen this before?
    Is there any way we can narrow down why this occurs?
    There is no logging on this export option and the stored
    procedures used are wrapped.
    Any ideas?
    Thanks
    Oracle Portal Version: 3.0.9.8.0

    we had this problem.
    We talked to some oracle person who said some portlets on a page had trouble exporting.
    Sure enough after we deleted all the portlets (one at a time to determine which one was giving us the problem. Turned out none of ours worked) the page exported and imported just fine.
    Hopefully this is being worked on...

  • ORA-01401 and ORA-12899 : "too large for column" error messages

    I posted this already in the Database - General forum.
    Sorry for the double post.
    For the past 8hours, I have been googling about
    the related ORA-01401 and ORA-12899 error
    messages.
    I noticed that ORA-01401 had been removed from the list
    of error messages in Oracle 10g documentation.
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10744/e900.htm#sthref30
    And, ORA-12899 has been added.
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10744/e12700.htm
    1. Is there an official Oracle document (e.g. release notes) stating such facts? If so, please provide the link.
    2. Why did Oracle change the error code and not just update ORA-01401?
    3. Someone posted in http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7143933880166
    Even if installed Oracle is 10g, when he tried to "insert a 100 into a number(2).",
    he supposedly got ORA-01401. So, is ORA-01401 still part of 10g or not?
    I have yet to confirm this myself.
    Sorry for being meticulous. Our customer just wants to know the
    information for the 2nd question. It's hard to convince them without
    showing official documents.
    Thanks!

    1)
    Well, go to Metalink and check out Note 119119.1 (B.4) and Note:287754.1
    2)
    Such details are seldom published. One guess is what they changed altered the reason behind the message so using the same code would be a bad idea.
    3)
    If you are referring to the occurrence of ora-1401 from a select on a XE db, that may be a bug.

  • Problems during creation of journalling triggers

    Hi,
    I'm using headstart 6.5.1.13 and when I try to create journalling triggers with the HSU, the utility proceeds normal, but when I view the log there's an error, "Exception; Note that the text for this element may have been corrupted".
    Result, the utility generates no pl-sql block. One other strange thing is that the utilty does not fail for every trigger. for example... The upd and ins triggers are ok but the del trigger is not generated.
    Please help
    Greetz Gerdo Veenink
    [email protected]

    Gerdo,
    You may be running into bug 2396132,
    which is fixed in Headstart patch 6.5.2.3 (you can download that patch using the Supplement Option).
    When running the utility 'Maintain Journalling Business Rules' for some
    tables, it causes the following error (Debug Detailed messages):
    bltext.get_line_containing
    Write Text for element type PLM with id
    830266772012969583230946129301974025
    - Text type: CDIPLS number of text lines = 16 - REPLACE
    Deleted old text
    Exception: ORA-1401: inserted value too large for column
    Length Buildstring 2048
    Line number 2 Text type = CDIPLS
    Exception; Note that the text for this element may have been corrupted.
    The problem is that the length of the buildstring is larger than 2000, which
    should not occur.
    Workaround:
    Modify package bltext (in schema of Utilities owner, e.g. HSU65),
    in procedure write_lines_to_repository,
    replace
    if length(l_text_lines(l_ctr + 1))+ 2 + length(l_build_string) > 1990
    by:
    if length(replace(l_text_lines(l_ctr + 1), chr(10), NL_CR)||NL_CR) +
    length(l_build_string) > 2000
    And also replace
    if nvl(length(l_build_string),'') > 0
    by:
    if nvl(length(l_build_string),0) > 0
    Hope this helps,
    Sandra

  • Importing from a different character set

    Oracle 8.1.7 / Windows NT
    I'm trying to import a dump file which was created with character set WE8ISO8859P9. My database uses character set UTF8. Some of the records can't be inserted because of error "ORA-1401: Value too large for column". Is this because of the different character sets? If I switch my session to WE8ISO8859P9, imp says "character set conversion from x to y not supported."
    How can I get these last records inserted? Here's an excerpt from the log:
    Verbunden mit: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - Production
    <
    Export-Datei wurde von EXPORT:V08.00.05 |ber konventionellen Pfad erstellt
    Warnung: Die Objekte wurden von NOC_ADMIN exportiert, nicht von Ihnen.
    Importvorgang mit Zeichensatz WE8ISO8859P9 und Zeichensatz UTF8 NCHAR durchgef|hrt
    Import-Server verwendet Zeichensatz UTF8 (mvgliche Zeichensatzkonvertierung)
    Export-Server verwendet Zeichensatz WE8ISO8859P9 NCHAR (mvgliche Zeichensatzkonvertierung)
    . Import NOC_ADMIN's Objekte in NOC_ADMIN
    . . Import der Tabelle "ACCESSROUTERIFS_" 782 Zeilen importiert
    . . Import der Tabelle "ITEM_"
    IMP-00019: Zeile zur|ckgewiesen aufgrund von Oracle-Fehler 1401
    IMP-00003: Oracle-Fehler 1401 gefunden
    ORA-01401: Eingef|gter Wert zu gro_ f|r Spalte
    Spalte 1 33886
    Spalte 2
    Spalte 3
    Spalte 4 1323
    Spalte 5
    Spalte 6 11
    Spalte 7 18600
    Spalte 8 18600
    Spalte 9 20-NOV-2000:00:00:00
    Spalte 10 processing
    Spalte 11 inactive
    Spalte 12
    Spalte 13
    Spalte 14 35682.0
    Spalte 15
    Spalte 16
    Spalte 17
    Spalte 18 05.12.00: KD weiss noch nix neues, er wird uns inf...
    Spalte 19
    Spalte 20 kschmid
    Spalte 21 09-FEB-2001:15:50:21
    Spalte 22
    Spalte 23 12
    Spalte 24
    Spalte 25 06-NOV-2000:00:00:00
    null

    Please try ORacle RDBMS support. this issues is to do with Oracle Import.

  • Cannot create smtp_in and smtp_out processes

    We are trying to create stmp processes to use with Oracle collaboration server in a single server installation (version 9i). In the log file for oid, we got error:
    [gsldad_AddChgLog] While adding Entry cn=ironman.interop-solutions.local:um_system:smtp_in:11156641524225588,cn=ironman.interop-solutions.local:UM_SYSTEM:smtp_in,cn=mailProcessConfig,cn=eMailServer,cn=G:\oracle\product\10.1.0\mtier,cn=ironman.interop-solutions.local,cn=Computers,cn=OracleContext in change log table, ORA-1401: ORA-01401: inserted value too large for column
    On the commandline window, we got:
    G:\oracle\product\10.1.0\mtier\bin>oesctl create instance ironman.interop-solutions.local:um_system:smtp_in
    Admin not using default pool.
    Unable to create a new instance oracle.mail.ldap.ESDSException: [ESDS error code
    - 10040] Naming Error Occured, See The Naming Error Message For Details
    [LDAP: error code 1 - Operations Error]
    javax.naming.NamingException: [LDAP: error code 1 - Operations Error]; remaining
    name 'cn=ironman.interop-solutions.local:um_system:smtp_in:111567347035960945,cn=ironman.interop-solutions.local:UM_SYSTEM:smtp_in,cn=mailProcessConfig,cn=eMai
    lServer,cn=G:\oracle\product\10.1.0\mtier,cn=ironman.interop-solutions.local,cn=
    Computers,cn=OracleContext'
    Is there anything we can do (like alter some table column size) to fix this problem?

    We are trying to create stmp processes to use with Oracle collaboration server in a single server installation (version 9i). In the log file for oid, we got error:
    [gsldad_AddChgLog] While adding Entry cn=ironman.interop-solutions.local:um_system:smtp_in:11156641524225588,cn=ironman.interop-solutions.local:UM_SYSTEM:smtp_in,cn=mailProcessConfig,cn=eMailServer,cn=G:\oracle\product\10.1.0\mtier,cn=ironman.interop-solutions.local,cn=Computers,cn=OracleContext in change log table, ORA-1401: ORA-01401: inserted value too large for column
    On the commandline window, we got:
    G:\oracle\product\10.1.0\mtier\bin>oesctl create instance ironman.interop-solutions.local:um_system:smtp_in
    Admin not using default pool.
    Unable to create a new instance oracle.mail.ldap.ESDSException: [ESDS error code
    - 10040] Naming Error Occured, See The Naming Error Message For Details
    [LDAP: error code 1 - Operations Error]
    javax.naming.NamingException: [LDAP: error code 1 - Operations Error]; remaining
    name 'cn=ironman.interop-solutions.local:um_system:smtp_in:111567347035960945,cn=ironman.interop-solutions.local:UM_SYSTEM:smtp_in,cn=mailProcessConfig,cn=eMai
    lServer,cn=G:\oracle\product\10.1.0\mtier,cn=ironman.interop-solutions.local,cn=
    Computers,cn=OracleContext'
    Is there anything we can do (like alter some table column size) to fix this problem?

  • REP-1401:'cf_1formula': Fatal PL/SQL error occured, ORA-01403: no data fou

    hi,
    my report is giving error REP-1401:'cf_1formula': Fatal PL/SQL error occured,
    ORA-01403: no data found
    There are two table emp1 and emp2 created from employees table from HR schema
    I have deleted some records from table emp2 where department id is 110
    main query is
    select employee_id, first_name, department_id from emp1
    now i created a foumula column
    function CF_1Formula return Number is
    dept number;
    begin
    select department_id into dept from emp2 where employee_id = :employee_id;
    return(dept);
    end;
    the above error is given when report is run. i tried
    exception
    when_no_data_found then
    dept:=000
    but problem is not solved
    i want to disply any number in this foumula column if the record is not found

    M. Khurram Khurshid wrote:
    exception
    when_no_data_found then
    dept:=000try this code in formula
    function CF_1Formula return Number is
    dept number;
    begin
    select department_id into dept from emp2 where employee_id = :employee_id;
    if dept is not null then
    return(dept);
    else
    return 0;
    end if;
    end; Hope this will help you...
    If someone response is helpful or correct please, mark is accordingly.

  • REP-1401 'beforereport' Fatal PL/SQL error occurred. ORA 00000 normal.

    Hi,
    I am running the report Journals - General (132 char)- file name GLRGNJ.rdf from
    Oracle Report Builder 6.0.8.11.3.
    I have commented all the (srw.user_exit) in the Before Report trigger but i still
    get the message:
    REP-1401 'beforereport' Fatal PL/SQL error occurred. ORA 00000 normal,
    successful completion.
    Can anyone suggest a solution please?
    Thanks,
    Faris

    Dear sir, i am created one formula column in Reports6i and the following error has come. Could u please find out a solution. Thanks in advance.
    my function is below
    function CF_Branch_NameFormula return Char is
    lc_branch_name varchar2(100);
    begin
    SELECT rtrim(substr(FVT.DESCRIPTION
    ,instr(FVT.DESCRIPTION,'-',1)+1
    ,100)) INTO lc_branch_name
    FROM FND_FLEX_VALUES FFV, FND_FLEX_VALUES_TL FVT
    WHERE FFV.flex_value_Set_id = 1007956
    AND FFV.FLEX_VALUE_ID = FVT.FLEX_VALUE_ID
    AND FFV.FLEX_VALUE = FVT.FLEX_VALUE_MEANING
    AND FVT.DESCRIPTION <> 'xxx'
    and rownum<=1
    AND SUBSTR(FVT.FLEX_VALUE_MEANING,3,2) = :P_BRANCH;
    return (lc_branch_name);
    end;

  • REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found

    Hi guys,
    I am getting error 'REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found ' when run the report
    and i m also use formula column in my report.
    can any body help me why it's coming.
    following code is used in formula column plz check and verify:
    function CF_3Formula return Char is
    T1 VARCHAR2(100);
    begin
    SELECT
         VAT_REG_NO INTO T1
    FROM
         JA_IN_HR_ORGANIZATION_UNITS JIHOU,
         HR_LOCATIONS HL--,
         --MTL_TXN_REQUEST_HEADERS MTLH
    WHERE
    JIHOU.ORGANIZATION_ID=HL.INVENTORY_ORGANIZATION_ID AND
    JIHOU.LOCATION_ID=HL.LOCATION_ID AND
    --Jihou.ORGANIZATION_ID = Mtlh.Organization_Id AND
    -- Hl.INVENTORY_ORGANIZATION_ID =Mtlh.Organization_Id AND
    -- MTLH.ATTRIBUTE10=SUBSTR(HL.LOCATION_CODE,1,3) AND
    SUBSTR(HL.LOCATION_CODE,1,3)= :TO_ORG1 ;
    RETURN (T1);
    end;
    plz help me out.

    Hi;
    What is EBS version? Is it custom report or not?
    See below which is mention similar errors
    Autoinvoice Error: ORA-1403: no data found [ID 1209403.1]
    APXIIMPT - Payable Open Interface Import Fails on "REP-1401: 'cf_source_nameformula': Fatal PL/SQL error occurred. ORA-01403: no data found" [ID 222058.1]
    Regard
    Helios

  • REP-1401: 'cf_10formula': Fatal PL/SQL error occurred. ORA-06502: PL/SQL: numeric or value error

    Hi Team,
    I am running one conc programme.
    After running I am getting below  error. I checked the issue on metalink  and other, seems that it is an size related issue. I have increased the size of formula columns and placeholdder too.
    But still getting issue.
    My requirement is to get comma seperated values using SQL query itself. Neither i wanted to create layout of the report , since it is a XML publisher report and nor  I am including it on RTF template.
    I want the CF_10 formula column to be populated with comma seperated values.
    MSG-00187: From Date 01-Sep-2014
    REP-1401: 'cf_10formula': Fatal PL/SQL error occurred.
    ORA-06502: PL/SQL: numeric or value error
    And Here is my code for CF_10
    function CF_10Formula return Number is
    begin
       SELECT NVL(TO_CHAR(sum(Amount),'99,99,99,999'),0) into :CP_5 --NVL(ROUND(sum(Amount)),0) into :CP_5
    --  xxhw_Coll_cat(category)     "Intercat  Catg"
    FROM hhxw_Region_col_v
    WHERE Category IN ('Intercompany - CATV')
    AND trunc(gl_date) BETWEEN TO_DATE(:P_FROM_DATE, 'DD/MM/RRRR') AND TO_DATE(:P_TO_DATE, 'DD/MM/RRRR');
    RETURN ROUND(:CP_5);
    end;
    Anyone please suggest me.
    Regards,
    Sachin

    Hi,
    1)Why are you selecting the value into a report item? Select into a local variable and return that
    RETURN :CP_5 --> This one!!
    2)And you should avoid applying functions to DB columns in where clauses wherever possible, so oracle can use indexes on them if applicable:
    AND gl_date >= To_date(:P_FROM_DATE, 'DD/MM/RRRR')
    AND gl_date < To_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
    I think you are taking 2 column in the Layout CF_10 and CP_5 right? if so, then use below Query.
    FUNCTION cf_10formula
      RETURN NUMBER
    IS
      v_amount NUMBER:null;
    IS
    BEGIN
      BEGIN
        SELECT nvl(round(SUM(amount)), 0)
        INTO   v_amount --> Retruns the value for CF_10 column
        FROM   hhxw_region_col_v
        WHERE  category IN ( 'Intercompany - CATV' )
        AND    gl_date >= to_date(:P_FROM_DATE, 'DD/MM/RRRR')
        AND    gl_date < to_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
        :CP_5 := nvl(trunc(v_amount),0); --> Retruns the value for CP_5 column
      EXCEPTION
      WHEN OTHERS THEN
        v_amount := 0;
        srw.message(1003,'Error in Getting  :' ||p_from_date);
      END;
    END;
    And
    If you've got a number function returning into a number field then all you should need to do to make the comma appear is to change the number format mask in field.
    From 40000 to 40,000

  • REP-1401: 'no_daysformula':Fatal PL/SQL error occured. ora-06503: PL/SQL : Functio returned without value. REP-0619: You cannot run without a layout.

    Hi everyone.
    Can anyone tell me what is wrong in this code below?
    Code:
    function NO_DAYSFormula return Number is
    begin
      IF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
      AND :P_TO_DT<:MATURITY_DATE
      AND :ACCT_OPN_DT>:P_FR_DT
      THEN RETURN (:P_TO_DT-:ACCT_OPN_DT+1);
      ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
      AND :P_TO_DT<:MATURITY_DATE
      AND :ACCT_OPN_DT<:P_FR_DT
      THEN RETURN (:P_FR_DT-:P_TO_DT+1);
      ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
       AND :P_TO_DT>:MATURITY_DATE
       AND :ACCT_OPN_DT<:P_FR_DT
      THEN RETURN (:P_FR_DT-:MATURITY_DATE+1);
      END IF;
    END;
    It gets compiled successfully but when i run the report, i get 2 errors.
    Error 1:
    REP-1401: 'no_daysformula':Fatal PL/SQL error occurred.
    ora-06503: PL/SQL : Function returned without value.
    Error 2:
    REP-0619: You cannot run without a layout.
    Should i use only 1 return statement?
    Can i use as many return statements as i want?
    What is the exact mistake? Please let me know.
    Thank You.

    Let me clear you the first thing...
    If you get any fatal errors while running the report (e.g., function returned without value,no value etc.,) the report will show
    REP-0619: You cannot run without a layout.
    So you just correct the function 'no_daysformula' .
    First of all you run the report without that formula column.
    If it works fine then , Check the return value of your formula column (Your formula column properties --> Return value --> value (It will be DATE as i think so).
    As function will always return a single value, Check your formula 'no_daysformula' returns the same.
    declare a return variable say for example..
    DECLARE
    V_DATE DATE;
    BEGIN
    --YOUR CODE---
    RETURN V_DATE := (RETURN VALUE)
    END;
    Last but not least ... use Else condition to return (NULL or any value ) in your code and check..
    If any Problem persists let me know
    Regards,
    Soofi.

Maybe you are looking for

  • Need to publish message from database to a JMS Queue using Java

    I need to publish messages to a Websphere JMS Queue whenever any changes happen on a particular column of a table in oracle 11g. For that I have written a trigger on that particular table which in turn will invoke one java procedure. I have written t

  • External monitor no longer works after installing iLife '09

    Before, the external monitor (Apple Cinema HD display) connected via DVI to Mini-DVI adapter was working fine. However, after installing iLife '09 and restarting, the iMac will no longer detect the external display attached to it. I even tried instal

  • Using a schema from a different Logical Data Service

    Is it possible to use a schema from a different Logical Data Service in a new Logical Data Service? I want to maintain just one version of the schema.

  • EPM metadata build

    Hi All, I am trying to load a dimension with Alias in EPMA, but getting the error as. "No dimension exists for the associated dimension property 'Alias' for Dimension 'Customers'" Below is my sample flatfile- *!Section=Dimensions* *'Name|DimensionCla

  • Special effect question - beginner

    I am a beginner at video editing.  In fact, I have never edited a video before.  My kids have a video with a wizard wand and want to have a lightning bolt come out of it and we can insert items to look like they created with magic.  Is this something