Oracle Report Error (string buffer too small) in Portal
Hi,
I have registered an oracle report (.rdf) with portal which works fine outside in Reports Builder, but when I try to run it in Portal it keeps throwing this error:
SQL-6502: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "PORTAL.WWV_RW_USR", line 444
ORA-06512: at "PORTAL.WWV_RW_USR", line 923
ORA-06512: at line 1
Anyone know what needs to be done to fix this?
Thanks
Sean:
Thank you very much for wading through my post.
>"if (NIerror = DAQmxCfgInputBuffer(h, numSamples*4))"
>I would leave this line out. DAQmx should create an input buffer automatically
>based on the number of channels and number of samples per channel.
Yeah- I put that in trying to fix the problem. The error message doesn't say *which* buffer is too small
>If you just call the DAQmxReadDigitalLines() function with "numSampsPerChan" set to -1,
>DAQmx will wait until all samples are acquired before performing the read.
I'm trying to avoid the wait. That's why I'm trying to figure out how many samples are ready.
I suppose I can try numSampsPerChan=-1, set a short timeout and check for the timeout error.
>If this does not help, please send me a small section of code that reproduces that behavior,
>and I will try running it on my machine.
I will try modifying one of the examples to do what I'm trying to do.
Again, Thank you!
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
Similar Messages
-
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,
AndyThanks 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 !
JessicaI 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
------------------------------------------------------------------- -
Bug: Report Column based on LOV character string buffer too small error
When using a column type of "Display as Text (based on LOV, does not save state)" with a result set that is rather large causes a character or string buffer too small oracle error.
See the below page for an example.
The example page below has a single report off a table called "HUGE_TABLE" which has two columns: display and code
Code contains a number between 0 and 100000.
Display contains the number in code appended to a block of text.
When I display the report with no Display As Text (based on LOV does not save state) it displays fine.
If I make the "Code" column display as text based on LOV and make the LOV
"SELECT display, code FROM huge_table"
I get the error you see on the page.
http://apex.oracle.com/pls/otn/f?p=32149:1
Thanks.Thanks for your help Scott.
So from what I've gathered from my own tests and the discussions you linked me to the LOVs based on SQL queries are being converted into "static LOV" strings before being used.
As such they are limited to the PL/SQL VARCHAR2 max size of 32767
Which means given the static reduction of the string 'STATIC:' that we have 32760 characters left.
Which is where your SUM( LENGTH( display ) + LENGTH( return ) + 2 ) comes in.
In short, if:
sum( length( display ) + length( return ) + 2 ) + 7 > 32767
would evaluate to true then you have a problem. :)
I'll use this to track down my problems and switch them over to inline queries.
Thanks.
Cheers,
Joe -
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,
SteveSteve,
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 -
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
ArnaudPlease report this problem to Oracle Support.
-
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,
rajThe 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. -
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] -
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 PMHi 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 -
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.1Hi 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. -
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 AMBrian,
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 -
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 character string buffer too small error
We trying to insert a string of more then 500 character from our VB.net application (uses ODP.net), its giving ORA-06502 character string buffer too small error.
Kindly help us on this.
OS version: AIX 5.1 (IBM/AIX RISC System/6000)
Oracle Database version: 9.2.0.1.0Just for reference and to close the loop, I found the fix to this problem (quite by accident).
The problem turned out to be a bug in the apex listener, which in some cases ended up doing a divide by zero, which caused the problem.
This is listed as a known bug, and a fixed listener is available.
Once I installed the fixed listener, problem solved!
Maybe you are looking for
-
Third party tool for document preview in sharepoint 2013
Hello, we are looking for third party tool which provide preview of any documents in documnet library in sharepoint 2013. So when users just hover over the document, they can see the preview. Do any of you please provide a good suggetion in case if y
-
I know there are ASCII characters past 128. They go all the way to 256 or so. When I type, System.out.println((char)156); I always get ? Now that's the character for 63, not 156. I always get ? for anything after 128.
-
Macbook air 2013 needs power button pressed for 10 seconds before it turns on?
macbook air 2013 needs power button pressed for 10 seconds before it turns on? also I've tried resting PRAM but when i press the 4 buttons before the start up screen it never restarts again? please help!
-
I'm trying to use the adobe SDK in a VB app to convert and HTML doc to a PDF behind the scenes. My program is going to be used to email our customers invoices after hours. Right now i can run my program to save the invoices as a HTML doc, i'm getting
-
I just installed CS4 Design Premium and I have been able to successfully open Photoshop, InDesign and Acrobat, but whenever I try to open Dreamweaver CS4 it hangs on the opening window at "Loading Site Cache..." I'm on a Dell PC running Windows XP Pr