Error PL/SQL: numeric or value error: character string buffer too small

HI oracle gurus,
I am new to PL/SQL,
my oracle version is oracle 11g.
i have create a procedure to insert data from flat file  to a table using UTL_FILE.
Table is
CREATE TABLE EXT_PERSON_INFO
  ID_PERSON              NUMBER(38),
  ID_BATCH             NUMBER(38),
  ID_PERSON_NBR        VARCHAR2(3 BYTE),
  ID_AREA              VARCHAR2(5 BYTE),
  NM_FINAL              VARCHAR2(20 BYTE),
  NM_START             VARCHAR2(20 BYTE),
  DT_DOB             DATE,
  ID_SERIAL               VARCHAR2(9 BYTE),
  DT_RESPONSE          DATE,
  TRANS_TYPE  VARCHAR2(2 BYTE),
  REG_RESPONSE  VARCHAR2(1 BYTE),
  TM_RX          TIMESTAMP(6)
my procedure is
CREATE OR REPLACE PROCEDURE PROC_PERSON
IS
  f_line VARCHAR2(2000);
  f utl_file.file_type;
  f_dir  VARCHAR2(250);
  fname  VARCHAR2(50);
  F_ID_PERSON EXT_PERSON_INFO.ID_PERSON%type :=1;
  F_ID_BATCH EXT_PERSON_INFO.ID_BATCH%type :=1;
  F_ID_PERSON_NBR EXT_PERSON_INFO.ID_PERSON_NBR%type;
  F_ID_AREA EXT_PERSON_INFO.ID_AREA%type;
  F_NM_FINAL EXT_PERSON_INFO.NM_FINAL%type;
  F_NM_START EXT_PERSON_INFO.NM_START%type;
  F_DT_DOB EXT_PERSON_INFO.DT_DOB%type;
  F_ID_SERIAL EXT_PERSON_INFO.ID_SERIAL%type;
  F_DT_RESPONSE EXT_PERSON_INFO.DT_RESPONSE%type;
  F_TRANS_TYPE EXT_PERSON_INFO.TRANS_TYPE%type;
  F_REG_RESPONSE EXT_PERSON_INFO.REG_RESPONSE%type;
BEGIN
  fname := 'D:\raj\raj.txt';
  f:= utl_file.fopen('RAJ',fname,'r'); 
loop
begin
utl_file.get_line(f,f_line);
exception
when no_data_found then
exit;
end;
F_ID_PERSON := 1;
F_ID_BATCH := 1;
F_ID_PERSON_NBR :=substr(f_line,1,3);
F_NM_FINAL := substr(f_line,4,22);
F_NM_START := substr(f_line,23,34);
F_DT_DOB := substr(f_line,35,44);
F_ID_SERIAL := substr(f_line,45,48);
F_DT_RESPONSE := substr(f_line,49,58);
F_TRANS_TYPE := substr(f_line,59,60);
F_REG_RESPONSE := substr(f_line,61,61);
F_ID_AREA := substr(f_line,62,64);
insert into EXT_PERSON_INFO VALUES (F_ID_PERSON,F_ID_BATCH,F_ID_PERSON_NBR,F_ID_AREA,F_NM_FINAL,F_NM_START,F_DT_DOB,F_ID_SERIAL,F_DT_RESPONSE,F_TRANS_TYPE,F_REG_RESPONSE);
end loop;
utl_file.fclose(f);
commit;
end;
am getting error
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
please help me in this regard. unable to trace the issue.
Thanks in advance
Regards,
raj

The error message should have included a line number for you to reference back to your code to know what line the error was occurring on.
That said, look at the documentation for SUBSTR as you are using the third parm incorrectly.  It is length, not end position.  That's your issue.

Similar Messages

  • 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

  • PL/SQL: numeric or value error (character string buffer too small)

    Hi All,
    Below is the procedure used to send notifications. It was working fine in previous DB version :- 10.1.0.5.0 and there was recent upgrade to 11.2.0.2.0.
    I complies fine, but when executing it throws the error.
    PROCEDURE PROC_STATUS_MAIL_UNADJ IS
           K_BOUNDARY CONSTANT VARCHAR2(1000) := 'a1b2c3d4e3f2g1';
          l_analysis_report  VARCHAR2(32767); --empty_clob; --clob :=
          l_header VARCHAR2(1000);
          l_footer VARCHAR2(200);
          cnxn UTL_SMTP.connection;
          cursor cloc is select location_id from locations order by location_id asc;
          loc_id cloc%rowtype;
    BEGIN
      dbms_output.enable (1000000);
         FOR loc_id in  cloc
         loop
         l_analysis_report := '<style type="text/css">
        <!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #FF0000}-->
        <!--.sidebar1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px}-->
        <!--.text { font-family: Arial, Helvetica, sans-serif; font-size: 12px}-->
        </style>
        <center><b><font face="Arial">Run Summary Report'
                    || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI AM') || '<br><br></font></b></center>'
                    || ' <div align="center"><table width="95%" border="1" cellspacing="0" cellpadding="1" </div>'
                    || '<span style="font-size: 10pt; font-family: Arial"> </span> '
                    || '<tr bgcolor=b4b4b4><td align="center"> <font size="3"> <b>'
                    || 'Analysis</b></td><td align="center"><font size="3"> <b>'
                    || 'Start Time</b></td><td align="center"><font size="3"> <b>'
                    || 'End Time</b></td><td align="center"><font size="3"> <b>'
                    || 'Run Duration (mins)</b></td><td align="center"><font size="3"> <b>'
                    || 'Status</b></font></td></tr> ' || UTL_TCP.CRLF;
                    FOR curr_refresh IN (SELECT AN.ANALYSIS_ID,AN.NAME ANALYSIS_NAME,TO_CHAR(ARH.RUN_START_TIME,'DD/MM/YYYY HH:MI:SS') START_TIME,
                                         TO_CHAR(ARH.RUN_END_TIME,'DD/MM/YYYY HH:MI:SS')END_TIME,
                                         ROUND(((ARH.RUN_END_TIME-ARH.RUN_START_TIME)*24*60),2) RUN_TIME_SECS,ARH.JOB_STATUS STATUS
                                         FROM
                                         RUN_HISTORY ARH,ANALYSES AN
                                         WHERE
                                         AN.ANALYSIS_ID=ARH.ANALYSIS_ID
                                         AND AN.CYCLE_IND_ID IN (1,3)
                                         AND ARH.RUN_START_TIME>TO_DATE(SYSDATE-30)
                                         AND ARH.JOB_NAME LIKE 'RHS_QU%'                                  
                                         AND AN.LOCATION_ID = loc_id.location_id
                                         AND ARH.JOB_STATUS='Completed'
                                         ORDER BY ARH.RUN_START_TIME DESC)
                           LOOP
                       l_analysis_report  := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
                          || '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
                          || curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
                          '</td><td align="center">'|| curr_refresh.status ||
                          '</td> </tr>' || UTL_TCP.CRLF;
                      exit when length (l_analysis_report) > 32500;
                   END LOOP;
                  l_analysis_report := l_analysis_report || '</table><br><br>';
                   l_footer := UTL_TCP.CRLF ||'<b> Note: This is an auto generated email. Please do not reply to it. Contact the IT team for any further information.</b>'||  UTL_TCP.CRLF;
                   FOR curr_email IN (SELECT GLOBAL_NAME INSTANCE_NAME,
                                      EU.EMAIL_USER_LAST_NAME last_name, EU.EMAIL_USER_FIRST_NAME ACNAME,
                                      EU.EMAIL_USER_EMAIL_ID,loc.LOCATION_NAME LOC_NAME,
                                      '[email protected]' MAIL_FROM
                                      FROM
                                      RHS_EMAIL_USER EU,LOCATIONS LOC,GLOBAL_NAME
                                      WHERE EU.LOCATION_ID=LOC.LOCATION_ID
                                      AND EU.LOCATION_ID=loc_id.location_id
                                  ) LOOP
                cnxn := UTL_SMTP.open_connection('smtprelay.inc.com', 25);
                UTL_SMTP.helo(cnxn, 'smtprelay.inc.com');
                UTL_SMTP.mail(cnxn, '[email protected]');
                UTL_SMTP.rcpt(cnxn, curr_email.EMAIL_USER_EMAIL_ID);
                      l_header := 'MIME-Version: 1.0'||'
    To: ' || curr_email.last_name || ' <' || curr_email.EMAIL_USER_EMAIL_ID || '>
    From: ' || curr_email.mail_from || '
    Subject: Un-Adjusted Analysis Report for ' || curr_email.loc_name || ' Location from' || curr_email.instance_name || ' on ' || to_char(sysdate, 'DD-MON-YYYY') || '
    Reply-To: [email protected]
    Content-Type: text/html;' || UTL_TCP.CRLF || UTL_TCP.CRLF;
                UTL_SMTP.data(cnxn, l_header || l_analysis_report || l_footer);
                UTL_SMTP.quit(cnxn);
                END LOOP;
                END LOOP;
    END PROC_STATUS_MAIL_UNADJ;
    Error :-
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SYS.UTL_SMTP", line 591
    ORA-06512: at "SYS.UTL_SMTP", line 497
    ORA-06512: at "SYS.UTL_SMTP", line 503
    ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 206
    ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 414
    ORA-06512: at line 2Can you please let me know if there is any issue with code or any upgrade issue ?
    Regards,
    Sunny
    Edited by: k_17 on Oct 13, 2011 12:07 PM

    Hi Helios,
    Many thanks for your reply.
    I am able to figure out the issue. In the code we have
    l_analysis_report  := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
                          || '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
                          || curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
                          '</td><td align="center">'|| curr_refresh.status ||
                          '</td> </tr>' || UTL_TCP.CRLF;
                      exit when length (l_analysis_report) > 32500;where "l_analysis_report VARCHAR2(32767);"
    The issue is report has more characters, and when executing it throws the error " ORA-06502: PL/SQL: numeric or value error: character string buffer too small ".
    Can you please let me know how to have more characters/data in the report. Will CLOB help if yes, please let me know how to use it.
    Kindly suggest some options.
    Regards,
    Sunny

  • 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

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

    Hi there...
    I'm sugin 9Iasv2 Portal.
    When i clik on the "approbations" tab in the parameters of a page, i always get this error :
    Erreur : ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Could you please help me ?
    regards
    Arnaud

    Please report this problem to Oracle Support.

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

    I have a field set to 'text field with autocomplete' and now that the data that is used for the LOV has increased dramatically it returns the following error 'ORA-06502: PL/SQL: numeric or value error: character string buffer too small'. Through trial and error I determined that if I restricted the number of rows returned using rownum < nnn then it would work. I then determined that I could use the trim and substring functions and remove the rownum restriction and it would work. Below is the LOV query. I have seen a couple of other posts similar to my problem and one of them asked if there was a way to increase the buffer size, but it was never answered. Is there a way, such as a parameter setting, that I could increase the buffer size for LOVs?
    select distinct substr(trim(item_requested),1,50) d
    from consolidated_components
    order by 1
    Thank you.

    Hi Scott
    Thanks very much for jumping in here.
    No, I didn't use the wizard to create the page. It was a manual operation but to tell you the truth the page has been changed so many times as I was working on different functionality and appearance that anything could have happened. I ended up having to manually create row processing processes and delete other processes, creating and hiding buttons, changing the way I'm passing item values, etc. I realize regardless of what I do as a developer the software should be able to handle all changes through it's interface but I've been in this business long enough to be realistic.
    I also could have done something blatantly stupid as I continue to learn this product. For those of us not yet totally comfortable with all the web development technology, Javascript, AJAX, etc., but are asked to develop applications that work best using those technologies sometimes we make elementary blunders.
    Thanks very much for your help. It is indeed appreciated.
    -gary

  • Numeric or value error: character string buffer too small

    Hi,
    I have no problem with this code :
    select htmldb_item.text(3,nom,20) nom,
    htmldb_item.select_list_from_query(9,v_urba_rue.ref_fantoir,'select distinct(nom_voie),v_urba_rue.ref_fantoir from adresse,v_urba_rue where adresse.ref_fantoir(+)=v_urba_rue.ref_fantoir and ref_commune=20 and v_urba_rue.ref_fantoir between 1280 and 1370') rue
    from personne,participe,adresse,v_urba_rue
    where ...
    but when i modify :
    ...and v_urba_rue.ref_fantoir between 1280 and 1400') rue...
    i have this error :
    ORA-06502 PL/SQL: numeric or value error: character string buffer too small
    any solution?
    thank you very much

    Is this the same posting as
    ORA-06502 numeric or value error string

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

  • Report error: numeric or value error: character string buffer too small.

    Full Details:
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
    MS Access runs this query but when I try to call a 'List of Values' in APEX that is in excess of 800 the error above displays. If I use a 'Pop Up' it will work but splits the list at 500. This is annoying and slower as I would like to be able to display all 850+ items in a named list of values. How do I increase the buffer size?
    Kind Regards,
    Steve

    Steve,
    Could you please post the query you're using? You're most like hitting one of two possible varchar2 limitations. If you're calling the apex_item API in your SQL query to render the select list, then you're limited to 8000 characters, this your option values and HTML code used to render this. In this case using the "XL" versions of the APIs might help, e.g. select_list_from_query_xl, because those return CLOBs. If you're already using those or if you're using the built-in display type "select list", then you could potentially hit the 32k character limit of varchar2 values in PL/SQL. In that case the best alternative is using a popup LOV instead.
    Regards,
    Marc

  • Numeric or value error: character string buffer too small in Package

    RVTTH-445: Subroutine ORA-06502: PL/SQL: numeric or value error: character string buffer too small in Package RCV_SeedEvents_PVT Procedure GET_CurrencyStatement -10 returned error
    Cause: Subroutine ORA-06502: PL/SQL: numeric or val
    Concurrent program RVCTP returned error
    Cause: RVCTP encountered an internal error. Parameters: RVCTP,IMMEDIATE,21229,
    Action: Note both this error number and the actions you are trying to perform. Contact your system adm
    RVTBM-008: Subroutine rvtbm_immediate_mngr() returned error
    Cause: Subroutine rvtbm_immediate_mngr() returned an internal error.
    Action: Note this error number and the actions you are trying to perform. Contact your syste
    RVTBM-120: Subroutine rvtptcontrol() returned error
    Cause: Subroutine rvtptcontrol() returned an internal error.
    Action: Note this error number and the actions you are trying to perform. Contact your system administrator
    Concurrent Manager encountered an error while attempting to start your immediate concurrent program RVCTP. Routine &ROUTINE received a return code of failure.
    Contact your support representative.
    Exceptions posted by this request:
    Concurrent Manager encountered an error while attempting to start your immediate concurrent program RVCTP. Routine &ROUTINE received a return code of failure.
    Contact your support representative.

    is the package an oracle apps standard package or customized package? if it is a customized package try to increase the size of the variable or parameter that is in question. otherwise if it is an oracle apps standard package you need to open a TAR.

  • ORA-06502 nuemeric or value error: character string buffer too small

    i am getting above error while doing
    ORA-06502 nuemeric or value error: character string buffer too small
    ORA-06512 itw_item_add_ch at line 17
    plz urgent
    CREATE OR REPLACE procedure itw_item_add_ch (header_id1 number, folio out varchar2,tariff out varchar2) as
    cursor item_add(header_id1 number) is
    SELECT
    DISTINCT c.attribute4 item_tariff_no,
    c.attribute5 item_folio
    FROM OE_ORDER_LINES_ALL b,
         mtl_system_items c
    WHERE b.flow_status_code not in ('SHIPPED','FULFILLMENT','CLOSED')
    and      b.inventory_item_id = c.inventory_item_id
    and     b.ship_from_org_id = c.organization_id
    and b.header_id = header_id1;
    begin
    for item_att in item_add(header_id1) loop
         if folio is null then
         folio := item_att.item_folio;
         else
         folio := folio||'/'||item_att.item_folio;
         end if;
         if tariff is null then
         tariff := item_att.item_tariff_no;
         else
         tariff := tariff||'/'||item_att.item_tariff_no;
         end if;
         end loop;
    end;

    if you want to find out which of your two variables are causing the problem, then use pragma exception_init along with "begin end exception" blocks within the loop.
    I've removed the procedure specification, so you can test this in SQL Plus. You need to supply a number to the Header_id1 variable something like this:
    set serveroutput on
    begin
      header_id1 number := 1; -- supply your own parameter here
      cursor Item_Add(Header_Id1 number) is
        select
              distinct c.Attribute4 Item_Tariff_No
             ,c.Attribute5          Item_Folio  
        from  Oe_Order_Lines_All    b
             ,MTL_System_Items      c
        where b.Flow_Status_Code    not in ('SHIPPED','FULFILLMENT','CLOSED')
        and   b.Inventory_Item_Id   = c.Inventory_Item_Id
        and   b.Ship_From_Org_Id    = c.Organization_Id
        and   b.Header_Id           = Header_Id1;
      exception TOO_MANY_CHARS;
      exception TOO_TARIFF_CHARS;
      pragma exception_init(TOO_MANY_CHARS, -6502);
      l_Folio varchar2(32747);
      l_Tariff varchar2(32747);
      l_Folio_Continue boolean  := true;
      l_Tariff_Continue boolean := true;
    begin
      for Item_Att in Item_Add(Header_Id1) loop
        if (l_Folio_Continue) then
          begin
            if l_Folio is null then
              l_Folio := Item_Att.Item_Folio;
            else
              l_Folio := l_Folio||'/'||Item_Att.Item_Folio;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Foilio has too many values ');
              l_Folio_Continue := false;
              exit;
          end;
        end if;
        if (l_Tariff_Continue) then
          begin
            if l_Tariff is null then
              l_Tariff := Item_Att.Item_Tariff_No;
            else
              l_Tariff := l_Tariff||'/'||Item_Att.Item_Tariff_No;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Tariff has too many values ');
              l_Tariff_Continue := false;
              exit;
        end if;
      end loop;
    end;
    /this is untested, so please sort out any compilation errors yourself.

  • BI Publisher Report Query Error: "character string buffer too small"

    Using apex.oracle.com, I am trying to make a Report Query (Shared Components > Report Queries) based on many columns (around 60).
    When I enter my SQL in the "Source Query" Text Area and then click Test Report I get the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small In order to try to make the simplest test case possible for this, I then tried entering SQL selecting just from DUAL.
    The following SQL fails with the error mentioned above.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    ,'wibble' as av
    FROM dualRemoving the last column from this SQL query (bringing the total number of columns down to 45) as follows and then clicking "Test Report" works successfully.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    FROM dualSo the question is: Is there a hard-coded limit of 45 columns for a Source Query? Or is there something else causing this error message?
    (For information in the above example I have "Use Generic Report Layout" selected and the output format set to "PDF")
    Thanks very much in advance for any comments or suggestions,
    Andy

    Thanks for the suggestion Simon.
    I just created a view based on the 46-column SELECT statement from dual above and then set "SELECT * FROM myview" as the Source Query.
    Unfortunately I get exactly the same error.
    Thanks,
    Andy

  • Report error:ORA-06502:character string buffer too small. urgent!!

    Hi guys,
    My APEX version is 3.0.1.00.08, my application run on my test environment, but on PROD environment, it raised the error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    In this page, on the left is a tree, the right side is a tabular form, when I click one tree node, it will pass the current node id to the form and the form will display the children data. When I click some tree node, it will raise the ORA-06502 error, but when click some other nodes, it is correct. I don't know why. And on my test environment, it has no this error, the test environment has same version with prod environment, only has less data in database. Could you help me???
    I searched in forum, someone says it's LOV problem, if it's LOV problem, all the nodes should have error, why click some nodes are ok?
    Thanks !
    Jessica

    I don't think it is related only to the number of rows but also to the content of the rows. So, counting only the number of rows doesn't say anything about if it is going to work or not. My question: can't you filter those entries? Making a choice between 250 entries in a tabular form isn't a simple task. Using popup-key LOV instead would also be a solution. However, if you use popup-key LOV be aware of the fact that you need two index numbers for those.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Character string buffer too small error in tabular form

    Hi Folks,
    One of my tabular forms suddenly stopped working out of the blue after 3 months of working perfectly. So I've run into the debug and looks like something went wrong rendering my LOV as below:
         0.16968     0.00328     ...Execute Statement: begin begin SELECT TIME_DISPLAY D, TIME_RETURN R bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value FROM TS_HOURS ORDER BY 2; end; end;     4     
    8
         0.17292     0.03912     ...Execute Statement: begin begin select /*+ cardinality(t 10) */ disp, val bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value from table(wwv_flow_utilities.get_temp_lov_data(2)) t order by insert_order, disp; end; end;     4     
    100
         0.21211     0.00224     report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too smallI've looked around and saw few others having same issues but nothing that's like mine. Could someone please help me find what the issue is? THanks.
    I am using Apex 4.1.1

    Hi Andre, I have figured out the issue.
    You were correct about the 32K limit. However it applies to the whole tabular form not to do with the particular LOV.
    I tweaked my other LOV's (with 200 return value) to display fewer and this issue was resolved. I think there wasn't enough left for my 60 row LOV by the time APEX engine got to it which renders after the bigger LOV was rendered.
    I think Advisor should have some kind of feature to check forms against 32k limit. Otherwise you wake up one morning and application broke after working 3 months perfectly.

  • Error in notification - "character string buffer too small"

    Hi All,
    Hope everyone is doing great...
    I have issue with one of the procedure which sends out status email for the reports. Below is the code.
    It worked fine from last six months but today it failed because of the length of characters (more reports are added).
    The variable "l_an_report" is VARCHAR and it has crossed it limit so gave the below error. Not sure how to handle the report so that it includes all the data.
    Also please let me if this is good solution :- Have the report status in excel sheet and attach to the email.
    If its fine please let me know how i can achieve this and any prerequisite from network team we need to get?
    ERROR :-
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "REPORT_STAT.PACKG_EMAIL", line 441
    ORA-06512: at line 2
    Procedure PRC_SUMMARY IS
          l_an_report varchar2(32767);
          l_header VARCHAR2(1000);
          cnxn UTL_SMTP.connection;
          P_job           NUMBER (10)    DEFAULT TO_NUMBER (TO_CHAR (SYSDATE,'YYYYMMDD'));
    BEGIN
                          l_an_report := '<style type="text/css">
    <!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #FF0000}-->
    <!--.sidebar1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px}-->
    <!--.text { font-family: Arial, Helvetica, sans-serif; font-size: 12px}-->
    </style>
    <center><b><font face="Arial">Summary Report '
                || '<br><br></font></b></center>'
                || ' <div align="center"><table width="90%" border="1" cellspacing="0" cellpadding="1"'
                || 'style="font-size: 10pt; font-family: Arial" > '
                || '<tr bgcolor=b4b4b4><td align="center"> <font size="3"> <b>'
                || 'Report</b></td><td align="center"><font size="3"> <b>'
                || 'Run Duration </b></td><td align="center"><font size="3"> <b>'
                || 'Status</b></font></td></tr> ' || UTL_TCP.CRLF;
                    FOR curr_refresh IN (SELECT
                                         AN.NAME report_NAME,
                                         ROUND(((ARH.RUN_END_TIME-ARH.RUN_START_TIME)*24*60),2) RUN_TIME,
                                         ARH.JOB_STATUS STATUS
                                         FROM
                                         REPORT_HISTORY ARH,REPORT AN
                                         WHERE
                                         ARH.RUN_START_TIME>TO_DATE(SYSDATE-93)
                                         AND AN.report_ID=ARH.report_ID
                                         and arh.JOB_NAME like 'QA%'
                                         and arh.JOB_STATUS='Completed')
                                  LOOP
              l_an_report  := l_an_report ||
              '<tr><td align="center">'|| curr_refresh.report_name|| '</td><td align="center">'|| curr_refresh.RUN_TIME ||
              '</td><td align="center">'|| curr_refresh.STATUS ||
               '</td><td align="center">' || UTL_TCP.CRLF;                      
                exit when length (l_an_report) > 32767;                   
          END LOOP;
           l_an_report := l_an_report || '</table><br><br>';
                FOR curr_email IN (SELECT global_name instance_name,
                REU.EMAIL_USER_LAST_NAME last_name,
                REU.EMAIL_USER_FIRST_NAME first_name,
                REU.EMAIL_USER_EMAIL_ID,
                '[email protected]' mail_from
                                 FROM EMAIL_USER REU, EMAIL_GROUP REG,GLOBAL_NAME
                                             WHERE REU.EMAIL_GROUP_ID = REG.EMAIL_GROUP_ID
                                                   AND REG.EMAIL_GROUP_NAME ='IT') LOOP
                cnxn := UTL_SMTP.open_connection('smtprelay.ats.com', 25);
                UTL_SMTP.helo(cnxn, 'smtprelay.ats.com');
                UTL_SMTP.mail(cnxn, '[email protected]');
                UTL_SMTP.rcpt(cnxn, curr_email.EMAIL_USER_EMAIL_ID);
                   l_header := 'MIME-Version: 1.0'||'
                   To: ' || curr_email.last_name || ' <' || curr_email.EMAIL_USER_EMAIL_ID || '>
                   From: ' || curr_email.mail_from || '
                   Subject: Summary Report for ' || curr_email.instance_name || ' on ' || to_char(sysdate, 'DD-MON-YYYY') || '
                   Reply-To: [email protected]
                   Content-Type: text/html;' || UTL_TCP.CRLF || UTL_TCP.CRLF;
                UTL_SMTP.data(cnxn, l_header || l_an_report);
                UTL_SMTP.quit(cnxn);
          END LOOP;
    END PRC_SUMMARY;Please share your thoughts.
    Regards,
    Sunny

    >
    It worked fine from last six months but today it failed because of the length of characters (more reports are added).
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    >
    The error is because you don't check the length of 'l_an_report' until it is already too long.
    This code checks the length AFTER adding to it.
    >
    l_an_report := l_an_report ||
    '<tr><td align="center">'|| curr_refresh.report_name|| '</td><td align="center">'|| curr_refresh.RUN_TIME ||
    '</td><td align="center">'|| curr_refresh.STATUS ||
    '</td><td align="center">' || UTL_TCP.CRLF;
    exit when length (l_an_report) > 32767;
    >
    You need to test the length of the new string to be added to make sure it won't cause 'l_an_report' to be too long
    -- add a new variable in the declare section
    v_new_string VARCHAR2(2000);
    -- in loop do calc
    v_new_string := '<tr><td align="center">'|| curr_refresh.report_name|| '</td><td align="center">'|| curr_refresh.RUN_TIME ||
              '</td><td align="center">'|| curr_refresh.STATUS ||
               '</td><td align="center">' || UTL_TCP.CRLF;                      
    -- test length
    IF (length(v_new_string) + length (l_an_report) > 32767 THEN EXIT;But as others have said if you need to handle lengths > 32767 then use an attachment as shown in the links provided.

Maybe you are looking for