Wrong forum!!!  character string buffer too small problem

Hi,
I'm using a pl/sql procedure which builds a string held by a VARCHAR2 variable, however i've just discovered that in certain situations this string exceeds 2000 characters and i get this error:-
ORA-20500: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
How can i stop this from happening. Do i need to use another datatype??
PROCEDURE p_build_string(p_string_to_build IN OUT VARCHAR2
,p_string_to_add IN VARCHAR2
,p_delimiter IN VARCHAR2) IS
BEGIN
/* initialise string */
IF INSTR(p_string_to_add,'''') <> 0 THEN
IF p_string_to_build IS NULL THEN
p_string_to_build := ''''||REPLACE(p_string_to_add,'''','''''')||'''';
l_number_of_string_items := 1;
ELSE
p_string_to_build := p_string_to_build||p_delimiter||''''||REPLACE(p_string_to_add,'''','''''')||'''';
l_number_of_string_items := l_number_of_string_items + 1;
END IF;
ELSE
IF p_string_to_build IS NULL THEN
p_string_to_build := ''''||p_string_to_add||'''';
l_number_of_string_items := 1;
ELSE
p_string_to_build := p_string_to_build||p_delimiter||''''||p_string_to_add||'''';
l_number_of_string_items := l_number_of_string_items + 1;
END IF;
END IF;
dbms_output.put_line(l_number_of_string_items || ' ' ||p_string_to_build);
END;
Message was edited by:
david_wood

I'm not suggesting this is your problem, but
select status
into v_status,
from registration_offender_xref But you have declared
      v_status  varchar2(10);Much better to declare things like this
      v_status  registration_offender_xref.status%type;That way you know your variable is declared with a proper length, if the column length ever changes ... your code doesn't go kaboom.
Cheers,

Similar Messages

  • Character string buffer too small problem

    hi, guys:
    I have a question that may be silly, I got error "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" when I run a query. if I uncomment "and rox.status='Active'" condition, I do not have the error. I guess it is related to some specific rows. I checked online, it looks the length of some varchar2 variable is not enough, but I just cannot find cause. I also notice there might be an error about v_level in the function, I should use number instead of varchar2 type. but after I changed the type of v_level, the error is still there. I would be cautious as this is a legacy system. Could anyone help me on this problem?
    I have a query like this:
    select *
    from registration_offender_xref rox
    where SOR_OFFENDER_DETAILS.get_offender_level(rox.offender_ID)=3
    --and rox.status='Active'
    and rox.end_registration_date is not null;I get error message as :
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SORS.SOR_OFFENDER_DETAILS", line 124
    06502. 00000 - "PL/SQL: numeric or value error%s"
    SOR_OFFENDER_DETAILS.get_offender_level return a number value from 1 to 3, or a null value. Here is the code
      function get_offender_level(p_offender_id IN NUMBER) return NUMBER as
          sex_offender_flag number;
          tier_level number;
          override_num number;
          v_status  varchar2(10);
          v_aggravated  varchar2(10);
          v_habitual  varchar2(10);
          v_level  varchar2(10);
          cursor tierNum is  -- as May 22, 2008 per HKT of DOC (past portal code), Level/Tier is displayed for all offenders
                   select max(c.tier)
          from sor_offense o, sor_offense_code c
                   where o.offender_id = p_offender_id
                   and o.OFFENSE_CODE = c.CODE_ID
          and upper(o.status) = 'ACTIVE';
      begin
          select count(*)
          into sex_offender_flag
          from registration_offender_xref rox
          where rox.offender_ID=p_offender_id
          and reg_type_ID=1;
          if sex_offender_flag>0 then
              OPEN tierNum;
              FETCH tierNum INTO v_level;
                if tierNum%NOTFOUND then
                tier_level := null;
                end if;
              CLOSE tierNum;
              select tier_overRide into overRide_Num
              from registration_offender_xref
              where offender_id = p_offender_id
              and reg_type_id = 1;
              if overRide_Num is not null then
                v_level:=overRide_Num;
              end if;
              --dbms_output.put_line('overRide_Num:'||overRide_Num);   
              --dbms_output.put_line('after override:'||p_level);
    /*error line*/        
                select status,  decode(aggravated,'Y','Yes','No') aggravated,
               decode(habitual,'Y','Yes','No') habitual
              into v_status,  v_aggravated, v_habitual
              from registration_offender_xref
              where offender_id = p_offender_id
              and reg_type_id = 1;
                if upper(v_status) in ('COMPLETED', 'DECEASED', 'DELETED') then
                   v_level := null;
                end if;
               --dbms_output.put_line('before final:'||p_level);
                if v_aggravated = 'Yes' or v_habitual = 'Yes' or v_level = 3 then
                   v_level := 3;
                end if;
               --dbms_output.put_line('final:'||p_level);
                if override_num is not null then
                   v_level := overRide_Num;
                end if;   
                   else
                v_level:=null;
          end if;
          return v_level;
      end get_offender_level;Thanks a lot!
    Sam
    Edited by: lxiscas on May 23, 2013 8:38 AM
    Edited by: lxiscas on May 23, 2013 8:41 AM
    Edited by: lxiscas on May 23, 2013 9:01 AM

    I'm not suggesting this is your problem, but
    select status
    into v_status,
    from registration_offender_xref But you have declared
          v_status  varchar2(10);Much better to declare things like this
          v_status  registration_offender_xref.status%type;That way you know your variable is declared with a proper length, if the column length ever changes ... your code doesn't go kaboom.
    Cheers,

  • 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" Classic Report Apex 3.2.1

    Hello Everyone,
    I know it is very old version I am discussing here but that is what we have in our environment, would really appreciate if anyone can help out.
    I have a classic report with the below query, in this I have added a filter using a select list item (P70_GROUP).
    SELECT vws.ServerID AS Display_ID,       vws.ServerID AS ID,       vws.Hostname,       vws.ServerStatus,       vws.SiteName AS Site,       vws.Client,       vws.CoreHours,       vws.Patch_Notes,       vws.PATCH_DEP,       vws.Patch_Day,       vws.PATCH_GROUPID,       vws.PATCH_TIMEID AS Time     FROM VW_Live_Support vws LEFT JOIN W_Patch_Groups wpg     ON (vws.Patch_GroupID = wpg.ID) WHERE vws.Deleteable      = 'N'   AND NVL(wpg.Ignore, 'N') = 'N'   AND ((:P70_GROUP > 1 AND vws.PATCH_GROUPID = :P70_GROUP) OR         (:P70_GROUP = 1 AND vws.Patch_GroupID IS NULL)      OR         (NVL(:P70_GROUP,0) = 0))   AND ( INSTR(UPPER(vws.HostName),    UPPER(NVL(:P70_SEARCH,vws.HostName)))    > 0 OR INSTR(UPPER(vws.ServerStatus), UPPER(NVL(:P70_SEARCH,vws.ServerStatus))) > 0 OR INSTR(UPPER(vws.SiteName),    UPPER(NVL(:P70_SEARCH,vws.SiteName)))    > 0 OR INSTR(UPPER(vws.Client),      UPPER(NVL(:P70_SEARCH,vws.Client)))      > 0 OR INSTR(UPPER(vws.CoreHours),    UPPER(NVL(:P70_SEARCH,vws.CoreHours)))    > 0 OR INSTR(UPPER(vws.Patch_Notes),  UPPER(NVL(:P70_SEARCH,vws.Patch_Notes)))  > 0       )
    Issue is when i select a group from the list I am getting
    "report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small".
    one unusual thing I have noticed here is when I select "All Groups" which returns 0, it is running fine and returning 3700 rows but when I select any group which returns some 10-20 rows I am getting the above error.
    can't understand why this is, please help me out.
    Regards,
    Tauceef

    Tauceef wrote:
    Thanks alot for your prompt response
    Let me add some more into the issue I forgot to add.
    It is somewhat similar to what Michael has mentioned in his first post.
    Above said report is a Tabular form and there are 3 select lists in it out of which one list is too long (Group list), when I hide it report works for all the groups.
    That should have been made clear in the original post. Reports and tabular forms are not the same thing. There's much more that can go wrong on tabular forms, including hitting the LOV size limit of 32KB for a select list item. (Obviously if you hit this limit for a single item then you've automatically hit it the report row limit as well.)
    I have explained them about the LOV that when we remove that LOV it works fine but they need that list because it is a updatable value.
    As suggested by Michael, I have tried Substr, which also works fine for all the groups.
    I would suggest client to have a short name of the groups and use it as a temporary solution.
    You should use a Pop-up LOV control for large lists of options. Purely as a usability consideration—irrespective of APEX implementation limits—select lists should only be used in cases where there are a maximum of around 200 options.
    Regarding Debugging: I am not getting that option when I run the application as a developer, checked the application properties Debugging option is selected as Yes, don't know why it is not available.
    That's not connected to this problem. Open a new thread on that topic if you want to investigate and fix it.
    One more confirmation from you guys please, I have also suggested them to upgrate the environment to the latest version, hoping this will resolve the issue, please confirm?
    In the latest version also we have same size (32KB) limit or it has been increased?
    The 32KB limits for select lists and report rows are not documented but are still present in APEX 4.2 (and in APEX 5.0 to the best of my current knowledge).

  • 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

  • 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

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

  • WWV_FLOW_WORKSHEET_CONDITIONS - ORA-06502 character string buffer too small

    Hi,
    I am currently working on a application that can upload CSV files inside many tables. Since I hate reinventing the wheels, I have decided to reverse engineer APEX and APEX APIs that are used by the SQL Workshop to upload CSV files to a single table. Since this feature was tested many times by many developers around the world, I know I can trust the code. If in a future release of APEX those packages are modified, I'll have to update my abstraction layer to call my own packages instead of APEX packages. (This is not an issue for our team.)
    First Step
    Use apex_040000.wwv_flow_load_data.create_csv_collection to create an apex collection with the first 20 rows of the csv file. At this step, we can validate the format of a sample of the file without loading all rows of the csv file.
    Second Step
    Use apex_040000.wwv_flow_load_data.load_csv_data to upload all rows of the csv file inside a table.
    Third Step
    Do whatever you want with the data inside the table. (i.e.: Send the data into multiple tables...)
    Here's my problem..._
    After the first or second steps, I display the data using interactive reports. I want to highlight every cells containing "invalid" data. I use apex_040000.wwv_flow_worksheet_api.add_or_update_highlight. When I have too many invalid cells, the IR doesn't show at run time, and you can see ORA-06502: PL/SQL: numeric or value error: character string buffer too small on the page.
    I would like to know the limitations of IR using the table WWV_FLOW_WORKSHEET_CONDITIONS. Is there a way to create many highlight conditions inside a single row of WWV_FLOW_WORKSHEET_CONDITIONS ? I want to find the best approach to add hundreds of conditions.
    Thanks
    Louis-Guillaume Carrier-Bédard
    My Google+: https://profiles.google.com/lgcarrier
    My Blog: http://www.lgcarrier.com
    Twitter: http://www.twitter.com/lgcarrier
    APEX Québec: http://www.apexquebec.com
    APEXFramework: http://www.apexframework.com

    At run time, when I look at the html source code, I can see all the generated CSS rules to highlight the cells of the IR.
    ie.: *.apexir_WORKSHEET_DATA tr td.rule_5352115461902443_td {background-color:#FF0000 !important;}*

  • Checkbox Item: character string buffer too small (APEX 4.0. - 4.2.)

    Hi all,
    I'm currently running the Oracle Application Express 4.0.2 on the Oracle DB 11g and thinking about the APEX upgrading to current 4.2. version. We have there quite big application used by the inernal employees so prior I need to test, if the migration will work.
    I installed the new server with database and the APEX 4.2. and import the current application. Everything seems to working good except few checkboxes, which returns me the error: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small."
    LOV (Source) Code of Checkbox Item:
    SELECT email as display_value, id as return_value
    FROM users
    WHERE <some conditions>;
    In the current version 4.0.2. I get the checkbox item (total count of the rows approx. 650), but in the 4.2. I get this "string buffer too small" error and the page could not be rendered (if I add to the same query limitation: "rownum<242" it will display the item).
    Could you please help me with this issue? Any idea, what I should set up in the new APEX to get the same results or you see there any limitation, why it does not work in the new version, but in the old version the same SQL works fine?
    Thank you all in advance.
    Regards,
    Tomas.

    1007462 wrote:
    Hi all,Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your forum profile with a real handle instead of "1007462".
    I'm currently running the Oracle Application Express 4.0.2 on the Oracle DB 11g and thinking about the APEX upgrading to current 4.2. version. We have there quite big application used by the inernal employees so prior I need to test, if the migration will work.
    I installed the new server with database and the APEX 4.2. and import the current application. Everything seems to working good except few checkboxes, which returns me the error: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small."
    LOV (Source) Code of Checkbox Item:
    SELECT email as display_value, id as return_value
    FROM users
    WHERE <some conditions>;
    In the current version 4.0.2. I get the checkbox item (total count of the rows approx. 650), but in the 4.2. I get this "string buffer too small" error and the page could not be rendered (if I add to the same query limitation: "rownum<242" it will display the item).
    Could you please help me with this issue? Any idea, what I should set up in the new APEX to get the same results or you see there any limitation, why it does not work in the new version, but in the old version the same SQL works fine?The total size of the HTML generated for an LOV-based item in APEX is restricted to 32K (this limit applies to every version). Why you are hitting this limit in the new instance may be due to differences in data or the database configuration (e.g. character set) rather than changes introduced in APEX.
    Is the data exactly the same? Is the database configuration the same? When you limit the number of rows so the checkboxes are displayed and view the page source, is there any difference in the HTML used to render the checkbox form elements between the two versions?
    That said, from a usability perspective 650 LOV options is rather a lot, and your application may very well outgrow this limit naturally in any version of APEX as more users as added. It is probably worthwhile thinking about other ways to display these options.

  • 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

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

  • Listener Error - character string buffer too small (ORA-06502)

    I am running into a very strange problem with the APEX listener on seemingly random pages. I can hit every page in my application just fine, but as soon as I hit this specific one, Glassfish throws an HTTP 500 error. If I click Debug, the page seems to load fine with no indications of trouble, but as soon as I turn debug back off, it goes back to the HTTP 500 error. I don't see anything special about the page that makes this happen. It is pretty simple and has 4 regions. I have noticed that if I set any 1 of the 4 regions to "Never display", the page loads fine. It's like having all 4 of them enabled at once are causing some overload, even though it's actually a smaller amount of data than most of my other pages.
    **Update: I just discovered this only happens if I'm logged into the workspace first and then try to run the page! If I log out of APEX and then hit the application as a normal user, page loads error-free. This is still an annoying problem, but at least it seems I have a decent workaround since regular users never see it.
    After a couple days, I noticed the exact same problem on a second APEX application I'm using. Again, it is on some random page whereas all the other pages work fine.
    Both applications and pages in question worked without issue in APEX 3.x. I am trying to get an APEX application up and running on the latest version.
    I have tried both Glassfish server and simply downloading the latest listener (version 1.1.1) and running it in standalone mode. I get the problem both ways, which is why it seems it's a listener issue.
    I have seen a few other threads of people having this problem, but I never did find anyone with a solution, and most of the posts stopped back in December.
    Some details on my environment:
    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    APEX version: 4.0.2
    Webserver: Glassfish 3.1
    Here is the log entry from Glassfish when the HTTP 500 error displays as I try to load one of the bugged pages.
    [#|2011-05-10T21:14:22.967-0500|INFO|oracle-glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=111;_ThreadName=Thread-1;|MaxConnectionReuseCount=50000|#]
    [#|2011-05-10T21:14:46.431-0500|SEVERE|oracle-glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=112;_ThreadName=Thread-1;|
    ***********ERROR***********
    init: # headers=46
    declare nm owa.vc_arr := ?;
    vl owa.vc_arr := ?;
    begin
    owa.init_cgi_env( ?, nm, vl );
    htp.init; htp.HTBUF_LEN := 63;
    ? := sys_context('USERENV','SID');
    end;
    SID:1242
    CALL:
    begin
    f(p=>?);
    commit;
    end;
    BINDS
    p:100:2:220529248574492::NOPAGE CALL:
    declare
    nlns number := 999999;
    l_clob CLOB;
    lines htp.htbuf_arr;
    l_buff varchar2(32767);
    l_clob_init boolean:= false;
    l_file varchar2(5);
    l_doc_info varchar2(1000);
    begin
    OWA.GET_PAGE(lines, nlns);
    if (nlns > 1) then
    for i in 1..nlns loop
    if ( length(lines(i)) > 0 ) then
    if ( ( lengthb(l_buff) + lengthb(lines(i))) > 32767) then
    if (NOT l_clob_init) then
    dbms_lob.createtemporary(l_clob, TRUE);
    dbms_lob.open(l_clob, dbms_lob.lob_readwrite);
    l_clob_init:=true;
    end if;
    dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
    l_buff := lines(i);
    else
    l_buff := l_buff || lines(i);
    end if;
    end if;
    end loop;
    end if;
    if (l_clob_init) then
    dbms_lob.writeappend(l_clob,length(l_buff),l_buff);
    l_buff := '';
    end if;
    ? := l_clob;
    ? := l_buff;
    if (wpg_docload.is_file_download) then l_file:='TRUE'; wpg_docload.get_download_file(l_doc_info); else l_file := 'FALSE'; end if; ? := l_file;
    ? := l_doc_info;
    end;
    get_page FAILED:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 33
    Edited by: BrianB on May 11, 2011 7:50 AM
    Edited by: BrianB on May 11, 2011 8:01 AM

    Brian,
    this post is going to get a bit longer, so the summary comes first.
    h6. Summary
    1. I could reproduce the problem on my system using the APEX Listener in standalone mode.
    2. I don't think the problem is content-related in the sense that you have any issue in your page or database contents.
    3. I have a workaround for your problem.
    h6. Error message
    Having that error in my environment made me start to think. I not only disabled some item and got it work, but I could also add something to achieve this effect.
    So I came to think, this really is somewhere deep down. The error message doesn't seem very helpful on first sight, but when starting to follow on what's happening there, things get clearer:
    APEX generates pages dynamically, replacing substitution strings and other tokens to get the actual page definition. This has to be read by a requesting client. The use of VARCHAR2 as buffer introduces a limit of 32767 bytes, after which the contents is handled as CLOB instead.
    h6. Analysis
    Obviously, there are cases where the "estimation" fails. Of course, this is may only be relevant in rare cases, because:
    1. If a page would exceed the maximum without some charset interpretation problem, the buffer would be switched to clob.
    2. If a page stays small enough to stay below 32767 even with some characters that are acutally larger then expected, the buffer isn't busted.
    To find out, if your could be one of these rare cases, I investigated the HTTP headers, focussing on X-DB-Content-length and made an odd observation.
    Test case 1: "Go" button disabled, so the page runs fine with APEX Listener
    1. It has *31968 bytes* when coming from APEX Listener with a Go button disabled.
    2. It has *31938 bytes* according to the header set by EPG - for exactly the same page.
    That makes a difference of 30 bytes for what is expected to be the same contents.
    Test case 2: The button is enabled again
    1. This causes the page load to crash in APEX Listener.
    2. EPG transports *32341 bytes* according to that header.
    So we are pretty close to the hard limit for the VARCHAR2 buffer.
    For some reason, APEX Listener seems to cause a false calculation of the actual page size. Whether this is due to some charset problem or due to some other problem with response handling, I don't know. The 30 bytes difference may result from the odd header "X-ORACLE-IGNORE" with value "IGNORE, IGNORE, IGNORE, IGNORE" sent by the APEX Listener. This value has exactly 30 bytes in length, but this could be coincidence, as there are more differences in headers. If I add the size of all headers, we are even closer to the buffer limit and probably exceed it when some items need more bytes than expected.
    This could even be as simple as a line break, as your page has about 424 lines when I disabled the button... Adding 1 byte per line to the 32341 bytes of the EPG, I get 32765 bytes. Now add that button (403 bytes difference on EPG) and you exceeed the limit. Reduce that value by the line count again and you are still below.
    Could be coincidence as well, but makes me wonder.
    h6. Workaround
    To make sure that we were actually hitting that limit, I now introduce my suggestion for a workaround.
    Test case 3: Add a hidden item
    1. APEX Listener loads the page, stating the size to be *32876 bytes*
    2. EPG sees 30 bytes less and transmits the header with *32846 bytes*
    h6. Conclusion
    I can't give you a real solution for that problem, nor do I have a definitive answer on what is the root cause for it. It seems, only one of the developers may find it. But I can offer you a workaround, which is to just add some hidden item to your page so it exceeds the limit for the VARCHAR2 buffer and gets handled as clob.
    Note that this may occur outside the app builder as well. The app builder just renders some additional items when starting that page, so it has a different size from its productive representation. On the other hand, I may start counting the size of that additional page section - I wouldn't wonder if that results in a value around 400 bytes, and this is the forgotten part...
    Unfortunately, if it actually is happening outside of the app builder, this workaround isn't very handy: Dynamic contents can't be calculated that easy all the time, so you may have cases where you just don't know in advance if you are close to the limit and have to add some item to exceed it or if you've already exceeded it or if you are far below, or close enough to actually hit it when adding just one byte...
    -Udo

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

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

  • Character string buffer too small

    ORA-19011: Character string buffer too small
    My query is regarding the above error. I have a requirement to concatenate two XMLType columns in the result set and am running into the above issue. Can you please let me know how I can workaround the above problem.
    Thanks,
    YM

    Error:     ORA-19011 (ORA-19011)
    Text:     Character string buffer too small
    Cause:     The string result asked for is too big to return back
    Action:     Get the result as a lob instead

Maybe you are looking for

  • How to unlock my disabled ipod touch

    Does anyone know how I can unlock my sons disabled ipod touck

  • Reading and internal table

    I have the following code but it doens't like  this line. Hod do i need to code this corectly LOOP AT WA_DATAPACKAGE INTO WA_DATAPACKAGE_LN.     wa_TABIX = SY-TABIX.         READ table DATA_PACKAGE INTO WA2_DATAPACKAGE_LN                      WITH KE

  • Pls help me.......pls... Cannot able to open the f...

    Dear friends I've Nokia 500 mobile and I want to open the following site in the Nokia default browser but I cannot able to open, means after loading period it displays a blank page the site addressis "https://inet.idbibank.co.in". Thanking you in adv

  • How to use the result from a taglib?

    Hi people. I've been looking arround for some feedback on how to use the output generated by a taglib on jsp code but I haven't been able to find any. Could somebody tell me how to do that please?

  • Mapping a Font into JVM

    Hi folks! First of all, excuse me because of my poor English. Now I am going to explain you the heart of the problem: I must map "Verdana" font (that is available in all of Window OSes, so it's not by default included into any JVM) so I can use this