Poltergeist in my code?... ORA-06502: PLSQL: Numeric or value error
Hi all!
I am experiencing a very strange problem,
i have the following code:
BEGIN
INSERT INTO BD_SESSION_GROUP
(CDSESION, NM_ANO, CD_CENTRO, CDGRUPO, FCSESION, ITREALIZADA)
VALUES (:DATOS.CDSESION,
:GLOBAL.CURSO_ACADEMICO,
:GLOBAL.COD_CENTRO,
:DATOS.CDGRUPO,
:DATOS.FECHA_EVAL,
REALIZADA
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
BEGIN
message('*1');
message('*2');
message('*3');
UPDATE BD_SESSION_GROUP
SET ITREALIZADA = REALIZADA,
FCSESION = :DATOS.FECHA_EVAL
WHERE NM_ANO = :GLOBAL.CURSO_ACADEMICO
AND CDSESION = :DATOS.CDSESION
AND CD_CENTRO = :GLOBAL.COD_CENTRO
AND CDGRUPO = :DATOS.CDGRUPO;
-- GO_ITEM('DATOS.IMPRIMIR');
EXCEPTION
WHEN OTHERS THEN
MENSAJE (SQLERRM || ' No se ha Podido Actualizar BD_SESSION_GROUP');
END;
WHEN OTHERS THEN
MENSAJE (SQLERRM || ' No se ha Podido Insertar en BD_SESSION_GROUP');
END;
I have checked that it enters in the WHEN DUP_VAL_ON_INDEX exception, and it shows the code
message('*1') and then message('*2');
this is correct, but the problem is that it doesn't show message('*3');
In fact, it shows the error "ORA-06502: PLSQL: Numeric or value error".
And more, i have checked that it doesn't matter what code you put above UPDATE BD_SESSION_GROUP...
it always crashes with the same error...
it don't really know what to do, because i have tryied using synchronize...
If someone can help me, it would be very apreciated,
thx in advance!!!
Given the message procedure and the mention of "synchronize" I'm assuming this is code from an Oracle Form. You might want to post this in the Forms forum as it could be more of a Forms question than a PL/SQL question.
Where are you seeing the error? On the message line? Do you have ON-MESSAGE or ON-ERROR triggers?
Similar Messages
-
ORA-06502 PLSQL Numeric or value error character string buffer too small
Hi
Gurus help!!
I received error message "ORA-06502: PL/SQL:Numeric or value error: character strong buffer too small." I use example code of "AJAX Get Multiple Values Tabular I" from Denes Kubicek http://apex.oracle.com/pls/otn/f?p=31517:239.
I did
1) create an application process on demand (set_multi_items_tabular)
2) create two application items (temporary_application_item and t_rownum)
3) create a report page (I assume) and put the below into the page header
<script language="JavaScript" type="text/javascript">
function f_set_multi_items_tabular(pValue, pRow){
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
if(pValue){
get.add('TEMPORARY_APPLICATION_ITEM',pValue)
get.add('T_ROWNUM',pRow)
}else{
get.add('TEMPORARY_APPLICATION_ITEM','null')
gReturn = get.get('XML');
if(gReturn){
var l_Count = gReturn.getElementsByTagName("item").length;
for(var i = 0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("item");
var l_ID = l_Opt_Xml.getAttribute('id');
var l_El = html_GetElement(l_ID);
if(l_Opt_Xml.firstChild){
var l_Value = l_Opt_Xml.firstChild.nodeValue;
}else{
var l_Value = '';
if(l_El){
if(l_El.tagName == 'INPUT'){
l_El.value = l_Value;
}else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
l_El.parentNode.innerHTML = l_Value;
l_El.parentNode.id = l_ID;
}else{
l_El.innerHTML = l_Value;
get = null;
</script>
4) Report Query is
SELECT apex_item.select_list_from_query
(31,
NULL,
'SELECT FIRST_NAME d, ' || 'EMPLOYEE_ID r FROM EMPLOYEES',
'style="width:250px" '
|| 'onchange="f_set_multi_items_tabular(this.value,''#ROWNUM#'''
|| ')"',
'YES',
'0',
'- Select FIRST NAME -',
'f31_' || '#ROWNUM#',
NULL,
'NO'
) BOOK,
apex_item.text (32,
NULL,
80,
100,
'style="width:190px" ',
'f32_' || '#ROWNUM#'
) FIRST_NAME,
apex_item.text (33,
NULL,
80,
100,
'style="width:190px" ',
'f33_' || '#ROWNUM#'
) LAST_NAME,
apex_item.text (34,
NULL,
80,
100,
'style="width:190px" ',
'f33_' || '#ROWNUM#'
) EMAIL,
FROM EMPLOYEES
I did modify Denes' code from table: my_book_store and columns: subject, price, author to match my sample table: EMPLOYEES and columns: FIRST_NAME, LAST_NAME, and EMAIL.
Am I missing some steps? Please advise and thank you in advance.
CandiceStupid me!! The size of select list is too big. After I delete some record from the table, that programs. Thanks for Denes Kubicek. I guess there is limitation of select list in Apex.
Candice -
Quote Form: Repeatively Query gives Error:ORA-06502: PLSQL numeric or value
Hi,
I am trying to query the sales order form (in Order Management) with the order number.
Steps to Reporduce:
Without closing the sales order form, query the same/different order number repetively again and again (upto 30 times) in sales order form and i am getting the following error. It might be due to the form buffer error i think, but i want to know how to resolve this issue.
ORA-06502 : PLSQL : numeric or value error
I have suggested the workaround as closing the form after querying every 15 times, but the customer needs a permanent fix by querying continously without closing the form, they want to query the record. Please suggest how to resolve this issue.
ThanksThe errors comes when in variable or fields data is coming more than the maximum length it.
e.g
declare
vcheck varchar2(1) := 'ABC'; ---Errorplz share your code where you feel the problem might occurring usually POST-QUERY trigger.
Baig,
http://baigsorcl.blogspot.com -
ORA-06502 PL/SQLnumeric or value error character to number conversion error
Hi,
I have written report in FastReport and I am using "Oracle Provider for OLE DB" for Oracle connection.
I have seen that my report throws oracle exception in some machines , so I analysed my PL/SQL and saw that problem occurs in "TO_NUMBER" function. (if i remove it exception does not occur)
However, same report works fine in another machine with the same data (same oracle provider version).
What can be the problem? What can be the dependence?
Thanks in advance
Elshan
p.s. Oracle provider version is 11.2.0.2.0Hi ,
the reason you are gettin this error is ecause sometimes in your data you are trying to convert a character to a number. When you say it works fine in other machine dos it mean for the same data set or a different data?
If you thing that you data may conatin a character and you still need to use TO_NUMBer than you should chack the data before converting and if it is a character than you should no do the conversion.
you can use this link to chek numeris or non numeric
How to check if a field is numeric?
thanks
Edited by: Himanshu Kandpal on Mar 31, 2011 7:55 AM -
Plugin tab menu - ORA-06502: PL/SQL: numeric or value error
Hi All ,
i import Tab menu and I want to use only the horizontal menu.
http://www.apex-plugin.com/oracle-apex-plugins/odtug-competition/tab-menu_203.html
I am getting following error.
" Error in PLSQL code raised during plug-in processing.
ORA-06502: PL/SQL: numeric or value error "
this my account
workspace : BUS_SOL
username : test
password : test123
Application name test123
I imported following component
1.region_type_plugin_net_vanbaren_apex_tab_menu_v1.01.sql2 in plugin
2.Theme_page_templates_A4.2.sql in theme
3.Tabmenu_verticale.css in css
I have no idea where I have to specify the tab and sub tab names.
It will be really helpful . if some one help on this.
Thank you
KarthikKarthik
Karthik C wrote:
I have no idea where I have to specify the tab and sub tab names.
The parent and standard tabs are defined at Shared Components > Tabs.
The basic idea of the plugin is to use the native tab concept of apex to make a "drop down" menu.
For a "drop down" menu you have to have two levels. So parent tabs and standard tabs. (Shared components > tabs)
The demo application you have in your apex.oracle.com workspace uses only one level of tabs (Only standard tabs). So the plugin will not work in this application.
Unfortunately there is no way of a application that is set up for one level tabs to turn into a two level tabs application. So please set up a new two level tab application before we go in more detail of how to use the plugin.
If you're going to use this plugin in a new applcation please please please start using lists instead of tabs.
List give more options than tabs.
List can have more than 2 levels. Tabs can have a maximum of 2 tabs and then only if you defined the application as 2 levels at creation.
And swiching a sublist entry between parents is just setting a different parent for the entry. For the tabs you not only need to change the standerd tab but also the page it references.
And in this case the most relevant there is already a drop down menu as list template. So there is no neason to use this plugin that needs isn't exactly plug and play.
Nicolette -
ORA-06502: PL/SQL: numeric or value error: character string buffer too smal
Hi Guys I am getting error ORA-06502: PL/SQL: numeric or value error: character string buffer too small as it said i thought it would be issue with length of feild but i tried to change is nothihg work i am posing code here if any one can please help me on this
PROCEDURE REPORT
p_rpt_from_dt in varchar2,
p_rpt_to_dt in varchar2,
p_apvr_id in tc_wkr.tc_row_id%type default NULL,
p_rpt_type in varchar2 default NULL,
p_backto_pg in varchar2 default NULL
IS
v_rpt_from_dt date := var_to_date(p_rpt_from_dt);
v_rpt_to_dt date := var_to_date(p_rpt_to_dt);
v_time_str varchar2(15);
cursor period_cur
cp_from_dt date,
cp_to_dt date
is
select beg_dt, end_dt
from jmcs_wk_tprd
where beg_dt <= cp_to_dt -- report end date
and end_dt >= cp_from_dt -- report start date
BEGIN
if sys_security('tcsys', 'tc_reports') != 'GRANTED' then
apps_main.access_denied;
return;
end if;
if lg_debug_fl then
v_time_str := to_char(lg_sysdate, 'hh:mi:ss a.m.');
else
v_time_str := tc_time(lg_sysdate);
end if;
/* get the time card time periods applicable to the report */
lga_tc_strt_dt := lga_null_date;
for recs in period_cur(v_rpt_from_dt, v_rpt_to_dt) loop
lga_tc_strt_dt(lga_tc_strt_dt.count+1) := recs.beg_dt;
lga_tc_end_dt(lga_tc_end_dt.count+1) := recs.end_dt;
end loop;
--if p_apvr_id is NULL then
if p_rpt_type != 'D' then
tc_reporting.reports_header
1,
'Time Card Status Report',
'for '||dd_mon_yyyy(v_rpt_from_dt)||' through '||dd_mon_yyyy(v_rpt_to_dt)||'<BR>'||
'Report Date: '||dd_mon_yyyy(lg_sysdate)||' Time: '||v_time_str,
NULL,
NULL,
NULL,
'javascript:window.close()', /* Backto */
'alert(''Reminder! Click on logo when you are ready to return to previous page'')'
end if;
if p_apvr_id is NULL then
sub_STATUS_BD_ALPHA (v_rpt_from_dt, v_rpt_to_dt, TRUE, p_rpt_type, p_apvr_id);
else
htp.p('<!-- Selected Approver ('||p_apvr_id||') -->');
sub_STATUS_BD_APVR (v_rpt_from_dt, v_rpt_to_dt, p_rpt_type, p_apvr_id);
end if;
htp.p('</body></html>');
EXCEPTION
WHEN OTHERS THEN
error_proc(SQLERRM, SQLCODE, owa_util.get_cgi_env('PATH_INFO'));
htp.p('Error Code is :'||SQLERRM);
END REPORT;
This package in trun call other procedure like below
PROCEDURE sub_STATUS_BD_ALPHA
p_rpt_from_dt in date,
p_rpt_to_dt in date,
p_display_hdr in boolean,
p_rpt_type in varchar2 default 'B',
p_apvr_id in tc_wkr.tc_row_id%type default NULL,
p_tcs_user_id in tc_wkr.tc_row_id%type default NULL
IS
v_time_str varchar2(15);
v_apvr_id tc_wkr.tc_row_id%type := 0;
v_a_user_id tc_wkr.tc_row_id%type; -- approver tcs_user_id
v_cnt integer := 0;
v_people_cnt integer := 0;
v_stat_cd varchar2(2000);
v_display_fl boolean := FALSE;
/*===========================================================================*/
cursor people_cur
cp_from_dt in date,
cp_to_dt in date
is
select
d_full_nm_lfm as name,
tc_row_id as tcs_user_id,
tcw_typ as pay_typ,
tcw_id as pay_id,
sys_strt_date as sys_strt_dt,
sys_end_dt
from tc_wkr
where sys_strt_date <= cp_to_dt
and nvl(sys_end_dt, cp_to_dt) >= cp_from_dt
order by upper(d_full_nm_lfm);
/* find the current or the most recent (if no current) approver */
cursor apvr_cur
cp_tcs_user_id in tc_wkr.tc_row_id%type
is
select
a.f_tc_apvr_id as fk_tcs_apvr_id,
w.d_full_nm_lfm as apvr_name,
w.tcw_typ as apvr_pay_typ,
w.tcw_id as apvr_pay_id,
a.strt_dt,
a.end_dt
from tc_wkr w, tc_ap_asmt a
where a.f_tc_wkr_id = cp_tcs_user_id
and w.tc_row_id = a.f_tc_apvr_id
order by a.strt_dt desc;
/* list of existing time cards UNION required time cards */
cursor tc_cur
cp_tcs_user_id in tc_wkr.tc_row_id%type, /* who's time cards */
cp_from_dt in date, /* report period from date */
cp_to_dt in date /* report period to date */
is
select
stat_cd,
strt_dt,
end_dt
from tc
where strt_dt <= cp_to_dt
and end_dt >= cp_from_dt
and fk_tc_wkrtcw_id = cp_tcs_user_id
UNION
select
'Required' as stat_cd,
beg_dt as strt_dt,
end_dt
from jmcs_wk_tprd
where beg_dt <= cp_to_dt
and end_dt >= cp_from_dt
and beg_dt not in (
select strt_dt
from tc
where strt_dt <= cp_to_dt
and end_dt >= cp_from_dt
and fk_tc_wkrtcw_id = cp_tcs_user_id
order by strt_dt;
BEGIN
if lg_debug_fl then
v_time_str := to_char(lg_sysdate, 'hh:mi:ss a.m.');
else
v_time_str := tc_time(lg_sysdate);
end if;
if p_apvr_id > 0 then
lga_report_out := lga_report_out_null;
v_apvr_id := p_apvr_id;
lga_apvr := lga_apvr_null;
select
d_full_nm_lfm,
tc_row_id,
tcw_id,
tcw_typ
into
lga_apvr(1).apvr_name,
lga_apvr(1).apvr_tcs_id,
lga_apvr(1).apvr_pay_id,
lga_apvr(1).apvr_pay_typ
from tc_wkr
where tc_row_id = v_apvr_id;
if lga_apvr(1).apvr_pay_typ != 'S' then
select decode(bend_empl_fl, 'Y', 'E', 'W')
into lga_apvr(1).apvr_pay_typ
from empl
where empl_id = lga_apvr(1).apvr_pay_id;
end if;
end if;
if p_display_hdr then
if lga_tc_strt_dt.count > 6 then /* more than 6 time periods (1 month) */
lga_width(1) := to_char(.15 * lg_page_width_standard);
lga_width(2) := to_char(.08 * lg_page_width_standard);
for i in 1..lga_tc_strt_dt.count loop
lga_width(lga_width.count+1) := to_char(.09 * lg_page_width_standard);
end loop;
lg_page_width_standard := to_number(lga_width(1)) + to_number(lga_width(2));
if nvl(p_apvr_id, 0) = 0 then
lg_page_width_standard := lg_page_width_standard * 2;
end if;
htp.p('<!-- page width = '||lg_page_width_standard||'-->');
for i in 3..lga_width.count loop
lg_page_width_standard := lg_page_width_standard + to_number(lga_width(i));
htp.p('<!-- page width = '||lg_page_width_standard||'-->');
end loop;
lg_page_width := to_char(lg_page_width_standard);
else
lga_width(1) := '15%';
lga_width(2) := '8%';
lga_width(3) := '9%';
lga_width(4) := '9%';
lga_width(5) := '9%';
lga_width(6) := '9%';
lga_width(7) := '9%';
lga_width(8) := '9%';
end if;
sub_DETAIL_PAGE_HD(p_apvr_id);
end if;
/* cursor loop */
for p in people_cur(p_rpt_from_dt, p_rpt_to_dt) loop
/* is/was this person assigned to the selected approver for the report period */
v_display_fl := FALSE;
if nvl(p_tcs_user_id, 0) > 0 then
if p_tcs_user_id = p.tcs_user_id then
htp.p('<br>Selected User');
v_display_fl := TRUE;
end if;
elsif nvl(p_apvr_id, 0) = 0 then
if nvl(p_apvr_id, 0) = 0 then
v_display_fl := TRUE;
elsif p_apvr_id > 0 or p_apvr_id = -1 then
v_display_fl := fct_ASSIGNED_APVR(p.tcs_user_id, p_apvr_id, p_rpt_from_dt, p_rpt_to_dt);
end if;
if v_display_fl then
v_people_cnt := v_people_cnt + 1;
lg_tcs_owner_info.USER_ID := p.tcs_user_id;
lg_tcs_owner_info.PAY_ID := p.pay_id;
lg_tcs_owner_info.PAY_TYPE := p.pay_typ;
lg_tcs_owner_info.SYS_STRT_DT := p.sys_strt_dt;
lg_tcs_owner_info.TERM_DT := p.sys_end_dt;
if p.pay_typ = 'S' then
begin
select wrk_hire_dt
into lg_tcs_owner_info.hire_dt
from subcntr
where sub_id = p.pay_id;
exception
when no_data_found then
tc_debug.html_message('subcntr.pay_id('||p.pay_id||')');
end;
else
select
wrk_hire_dt,
decode(bend_empl_fl, 'Y', 'E', 'W')
into
lg_tcs_owner_info.hire_dt,
lg_tcs_owner_info.pay_type
from empl
where empl_id = lg_tcs_owner_info.PAY_ID;
end if;
if lga_report_out.count = 0 then
lga_report_out(lga_report_out.count+1) := '<table border="1" cellpadding="3" width="'||lg_page_width||'">';
end if;
if mod(v_people_cnt,2) = 1 then
lga_report_out(lga_report_out.count+1) := ('<tr bgcolor="'||lg_odd_bgcolor||'">');
else
lga_report_out(lga_report_out.count+1) := ('<tr bgcolor="'||lg_even_bgcolor||'">');
end if;
lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>'||p.name||'</font></td >');
lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>'||p.pay_typ||'-'||lpad(p.pay_id,4,'0')||'</font></td >');
if nvl(p_apvr_id, 0) > 0 then /* Single Approver */
/* need approver ID for time card "status" */
lga_apvr := lga_apvr_null; /* clear the approver id array */
lga_apvr(1).apvr_tcs_id := p_apvr_id;
elsif nvl(p_apvr_id, 0) = 0 then /* ALL Approvers */
lga_apvr := lga_apvr_null; /* clear the approver id array */
v_cnt := 0;
for ap in apvr_cur (p.tcs_user_id) loop
if v_cnt = 0 then
/* most recent approver may not be the applicable approver */
v_cnt := 1;
lga_apvr(v_cnt).apvr_name := ap.apvr_name; -- identify multiple approvers for the "status"
lga_apvr(v_cnt).apvr_tcs_id := ap.fk_tcs_apvr_id; -- identify multiple approvers for the "status"
lga_apvr(v_cnt).apvr_pay_id := ap.apvr_pay_id; -- identify multiple approvers for the "status"
v_apvr_id := ap.fk_tcs_apvr_id;
if ap.apvr_pay_typ = 'S' then
lga_apvr(v_cnt).apvr_pay_typ := ap.apvr_pay_typ; -- identify multiple approvers for the "status"
else
select decode(bend_empl_fl, 'Y', 'E', 'W')
into lga_apvr(1).apvr_pay_typ
from empl
where empl_id = lga_apvr(1).apvr_pay_id;
end if;
end if;
if ap.strt_dt <= p_rpt_to_dt and nvl(ap.end_dt, p_rpt_to_dt) >= p_rpt_from_dt then
/* approver record */
lg_tcs_owner_info.APVR_ID := ap.fk_tcs_apvr_id;
lg_tcs_owner_info.APVR_STRT_DT := ap.strt_dt;
lg_tcs_owner_info.APVR_END_DT := ap.end_dt;
don't enter same approver name multiple times
when same approver has been assigned more than once
Example: approver1, approver_2, approver_1 (change back to approver 1)
for i in 1..lga_apvr.count loop
v_apvr_id := ap.fk_tcs_apvr_id;
if lga_apvr(i).apvr_tcs_id = ap.fk_tcs_apvr_id then
/* don't add again */
v_apvr_id := NULL;
exit;
end if;
end loop;
if v_apvr_id is not NULL then
v_cnt := v_cnt + 1;
lga_apvr(v_cnt).apvr_name := ap.apvr_name; -- identify multiple approvers for the "status"
lga_apvr(v_cnt).apvr_tcs_id := ap.fk_tcs_apvr_id; -- identify multiple approvers for the "status"
lga_apvr(v_cnt).apvr_pay_id := ap.apvr_pay_id; -- identify multiple approvers for the "status"
lga_apvr(v_cnt).apvr_pay_typ := ap.apvr_pay_typ; -- identify multiple approvers for the "status"
end if;
end if;
end loop;
/* list approver pay IDs */
lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
if lga_apvr.count = 0 then
lga_report_out(lga_report_out.count+1) := 'Approver Unassigned';
else
for i in 1..lga_apvr.count loop
if i > 1 then
lga_report_out(lga_report_out.count+1) := '<br>';
end if;
lga_report_out(lga_report_out.count+1) := (lga_apvr(i).apvr_name);
end loop;
end if;
lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
if lga_apvr.count = 0 then
lga_report_out(lga_report_out.count+1) := 'N/A';
else
for i in 1..lga_apvr.count loop
if i > 1 then
lga_report_out(lga_report_out.count+1) := '<br>';
end if;
lga_report_out(lga_report_out.count+1) := (lga_apvr(i).apvr_pay_typ)||'-'||lpad(lga_apvr(i).apvr_pay_id,4,'0');
end loop;
end if;
lga_report_out(lga_report_out.count+1) := ('</font></td >');
end if;
for t in tc_cur(p.tcs_user_id, p_rpt_from_dt, p_rpt_to_dt) loop
htp.p('<! '||t.strt_dt||', '||t.end_dt||', '||t.stat_cd||' -->');
--lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
--lga_report_out(lga_report_out.count+1) := (t.stat_cd);
--lga_report_out(lga_report_out.count+1) := ('</font></td >');
/* has the selected approver has completed processing */
if p_apvr_id > 0
and v_apvr_id = p_apvr_id
and v_a_user_id != p_apvr_id
then
exit;
end if;
for ap in apvr_cur (p.tcs_user_id) loop
if apvr_cur%rowcount = 1 then
/* most recent approver assigned */
lg_tcs_owner_info.apvr_id := ap.fk_tcs_apvr_id;
end if;
if ap.strt_dt <= t.end_dt and nvl(ap.end_dt, t.end_dt) >= t.strt_dt then
/* approver assigned during time card period */
lg_tcs_owner_info.apvr_id := ap.fk_tcs_apvr_id;
exit;
end if;
end loop;
lg_tc_status.strt_dt := t.strt_dt;
lg_tc_status.end_dt := t.end_dt;
lg_tc_status.stat_cd := t.stat_cd;
v_stat_cd := fct_TC_STATUS(nvl(p_apvr_id, 0));
lga_report_out(lga_report_out.count+1) := ('<td align="center" valign="top" bgcolor="'||lg_tc_status.bg_color||'">');
lga_report_out(lga_report_out.count+1) := ('<font size=-2 color='||lg_tc_status.font_color||'>');
lga_report_out(lga_report_out.count+1) := v_stat_cd;
lga_report_out(lga_report_out.count+1) := ('</font></td >');
end loop;
lga_report_out(lga_report_out.count+1) := '</tr>';
end if; /* v_display_fl */
end loop;
if p_rpt_type in ('B', 'S') then
lg_page_cnt := lg_page_cnt + 1;
sub_DISPLAY_STATUS_SUMMARY;
end if;
if lga_report_out.count > 0 then
lga_report_out(lga_report_out.count+1) := '</table>';
end if;
if lga_report_out.count > 0 then
if p_rpt_type = 'B' or p_apvr_id > 0 then
if p_display_hdr then
if lg_page_cnt > 0 then
if p_apvr_id > 0 then /* selected individual approver */
htp.p('</table>');
end if;
htp.p('<br style="page-break-after:always">');
htp.p('<!-- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -->');
htp.p('<!-- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -->');
end if;
lg_page_cnt := lg_page_cnt + 1;
tc_reporting.reports_header
1,
'Time Card Status Report',
'for '||dd_mon_yyyy(p_rpt_from_dt)||' through '||dd_mon_yyyy(p_rpt_to_dt)||'<BR>'||
'Report Date: '||dd_mon_yyyy(lg_sysdate)||' Time: '||v_time_str,
NULL,
NULL,
NULL,
NULL, -- p_backto_pg, /* Backto */
'focus()',
lg_page_cnt
end if;
end if;
if p_rpt_type in ('B', 'D') then
for i in 1..lga_report_out.count loop
htp.p(lga_report_out(i));
end loop;
end if;
end if;
END sub_STATUS_BD_ALPHA;
Some veriable
type report_tc_rec is record
tc_owner_name tc_wkr.d_full_nm_lfm%type,
o_user_id tc_wkr.tc_row_id%type,
o_pay_id varchar2(10),
o_sys_strt_dt date,
o_sys_end_dt date,
tc_apvr_name tc_wkr.d_full_nm_lfm%type,
a_pay_id varchar2(10),
a_user_id tc_wkr.tc_row_id%type,
tc_strt_dt date,
tc_end_dt date,
tc_stat_cd varchar2(50),
ap_strt_dt date,
ap_end_dt date
/* time card owner information */
TYPE tcs_owner_info_rec IS RECORD
USER_ID tc_wkr.tc_row_id%type,
PAY_ID tc_wkr.tcw_id%type,
PAY_TYPE tc_wkr.tcw_typ%type,
HIRE_DT date,
SYS_STRT_DT date,
TERM_DT date,
APVR_ID tc_wkr.tc_row_id%type,
APVR_STRT_DT date,
APVR_END_DT date
/* status code determines report cell font and background colors */
TYPE tc_status_rec IS RECORD
STRT_DT date,
END_DT date,
STAT_CD tc.stat_cd%type,
FONT_COLOR varchar2(16),
BG_COLOR varchar2(16)
/* count of all time card status for report summary */
TYPE tc_status_summary_rec IS RECORD
APPROVED_CNT integer := 0,
REJECTED_CNT integer := 0,
SUBMITTED_CNT integer := 0,
POSTED_CNT integer := 0,
VERIFIED_CNT integer := 0,
OPEN_CNT integer := 0,
NEW_CNT integer := 0,
REQUIRED_CNT integer := 0,
TOTAL_CNT integer := 0
/* determine multiple approvers for individual for selected report period */
TYPE apvr_rec IS RECORD
apvr_name tc_wkr.d_full_nm_lfm%type,
apvr_tcs_id tc_wkr.tc_row_id%type,
apvr_pay_id tc_wkr.tcw_id%type,
apvr_pay_typ tc_wkr.tcw_typ%type
TYPE apvr_id_array_table IS TABLE OF apvr_rec
index by binary_integer;
type output_array is table of varchar2(1000)
index by binary_integer;
type date_array is table of date
index by binary_integer;
type status_array is table of varchar2(1000)
index by binary_integer;
type apvr_array is table of number(8)
index by binary_integer;
lga_report_out output_array; /* array of HTML code to be output to browser */
lga_report_out_null output_array; /* null array of HTML code */
lga_tc_status status_array;
lga_null_status status_array;
lga_tc_strt_dt date_array;
lga_tc_end_dt date_array;
lga_tc_disp date_array; /* start dates of displayed TC for selected user */
lga_null_date date_array; /* null array used to clear other date arrays */
/* LOCAL GLOBAL VARIABLES */
lg_tcs_owner_info tcs_owner_info_rec; /* time card owner information */
lg_tc_status tc_status_rec; /* time card status information */
lg_tc_status_summary tc_status_summary_rec; /* time card count by status */
lg_tc_rec report_tc_rec; /* time card */
lga_apvr apvr_id_array_table; /* array of approver Names and Payroll IDs */
lga_apvr_null apvr_id_array_table; /* clear the lga_apvr array for each user */
lg_sysdate date := sysdate;
lg_debug_fl boolean := FALSE;
lg_debug_owner_id tc_wkr.tc_row_id%type := 9905;
lg_debug_apvr_id tc_wkr.tc_row_id%type := 1000;
The chnages i have done its in bold
Please Advice
Thanks
Edited by: Purvik on Aug 25, 2009 11:59 AMThere is not a chance in the world, especially not knowing column definitions that I, and I suspect most anyone else, is going to wade through this much unformated code looking for an error you couldn't bother to copy in full.
Either tell us, specifically, the line on which the error is occurring or, better yet, start whacking stuff out of your code until you find the offending definition. That is certainly what I would do. Commenting out sections is a marvelous way to quickly find an issue.
Before you post again please read the FAQ. It will explain to you how to properly post and use the tags. -
Hi Team,
I am running one conc programme.
After running I am getting below error. I checked the issue on metalink and other, seems that it is an size related issue. I have increased the size of formula columns and placeholdder too.
But still getting issue.
My requirement is to get comma seperated values using SQL query itself. Neither i wanted to create layout of the report , since it is a XML publisher report and nor I am including it on RTF template.
I want the CF_10 formula column to be populated with comma seperated values.
MSG-00187: From Date 01-Sep-2014
REP-1401: 'cf_10formula': Fatal PL/SQL error occurred.
ORA-06502: PL/SQL: numeric or value error
And Here is my code for CF_10
function CF_10Formula return Number is
begin
SELECT NVL(TO_CHAR(sum(Amount),'99,99,99,999'),0) into :CP_5 --NVL(ROUND(sum(Amount)),0) into :CP_5
-- xxhw_Coll_cat(category) "Intercat Catg"
FROM hhxw_Region_col_v
WHERE Category IN ('Intercompany - CATV')
AND trunc(gl_date) BETWEEN TO_DATE(:P_FROM_DATE, 'DD/MM/RRRR') AND TO_DATE(:P_TO_DATE, 'DD/MM/RRRR');
RETURN ROUND(:CP_5);
end;
Anyone please suggest me.
Regards,
SachinHi,
1)Why are you selecting the value into a report item? Select into a local variable and return that
RETURN :CP_5 --> This one!!
2)And you should avoid applying functions to DB columns in where clauses wherever possible, so oracle can use indexes on them if applicable:
AND gl_date >= To_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < To_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
I think you are taking 2 column in the Layout CF_10 and CP_5 right? if so, then use below Query.
FUNCTION cf_10formula
RETURN NUMBER
IS
v_amount NUMBER:null;
IS
BEGIN
BEGIN
SELECT nvl(round(SUM(amount)), 0)
INTO v_amount --> Retruns the value for CF_10 column
FROM hhxw_region_col_v
WHERE category IN ( 'Intercompany - CATV' )
AND gl_date >= to_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < to_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
:CP_5 := nvl(trunc(v_amount),0); --> Retruns the value for CP_5 column
EXCEPTION
WHEN OTHERS THEN
v_amount := 0;
srw.message(1003,'Error in Getting :' ||p_from_date);
END;
END;
And
If you've got a number function returning into a number field then all you should need to do to make the comma appear is to change the number format mask in field.
From 40000 to 40,000 -
SQL Report query ORA-06502: PL/SQL: numeric or value error: character strin
Hello,
I have saved below query in the sql scripts, which executes good under SQL Developer,
select "RVV"."RLNUM" as "RLNUM",
"GVREB"."RLNUM" as "RLNUM",
"TVV"."RLNUM" as "RLNUM_1",
"Regulation"."CODE" as "CODE",
"Regulation"."NAAM" as "NAAM",
"GVREB"."BRONCODE" as "BRONCODE",
sum(RVV.RVV_MODULATIE) as "RVV_MODULATIE",
sum(RVV.RVV_EXTRA_MODUL) as "RVV_EXTRA_MODUL",
sum(GVREB.PMB) as "PMB",
sum(GVREB.VVM) as "VVM",
sum(GVREB.VVEM) as "VVEM",
"GVREB"."STATUS" as "STATUS",
sum(TVV.VVM) as "VVM",
sum(TVV.VVEM) as "VVEM",
"Regulation"."version" as "version",
"TVV"."Appyear" as "Appyear"
from "GVREB" "GVREB",
"RVV" "RVV",
"TVV" "TVV",
"Regulation" "Regulation"
where "RVV"."RLNUM" = :P17_Relationnum
and "GVREB"."RLNUM" = "RVV"."RLNUM"
and "TVV"."RLNUM" = "GVREB"."RLNUM"
and "GVREB"."CODE" = "TVV"."RegulationSCODE"
and "Regulation"."CODE" = "GVREB"."CODE"
and "GVREB"."STATUS" = 'VWT'
and "TVV"."Appyear" = 2009
group by RVV.RLNUM, GVREB.RLNUM, TVV.RLNUM, Regulation.CODE, Regulation.NAAM, GVREB.BRONCODE, GVREB.STATUS, Regulation.version, TVV.Appyear
order by Regulation.version ASC
however when tried to put in the region -> query builder it gives below error,
italics ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Return to application.+italics+
Kindly suggest me work around this error.
Cheers,
G1R15|-|
Edited by: G on Jul 11, 2010 10:03 PMHi,
I was able to resolve the issue. I changed it to = To_Number while assigning.
and for other issue, earlier I choose "Select List" for drop down. I changed this to "Select list with Submit". for the issue of "depending on this values in the report should get change"
Thanks for your support,
Girish -
I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option. The SQL query generated will possibly be over 32K. When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated. I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL. I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL. Our environment is on 11gR2 and using ApEx 4.2.1. I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using. Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
As a test, I created a page on apex.oracle.com with a report region with the following source:
declare
l_stub varchar2(25) := 'select * from sys.dual ';
l_sql clob := l_stub || 'union all ';
br number(3) := 33;
begin
while length ( l_sql ) < 34000 loop
l_sql := l_sql || l_stub || 'union all ';
end loop;
l_sql := l_sql || l_stub;
for i in 1 .. ceil ( length ( l_sql ) / br ) loop
dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
end loop;
return l_sql;
end;
The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K. When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed. When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g. Thoughts?
Shane.What setting do you use in your report properties - especially in Type and in Region Source?
If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
declare
mycond varchar2(4000);
begin
if :P1_REPORT_SEARCH is not null THEN
mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
end if;
return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
end;
And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
(You would than need to change the code of your function accordingly).
If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query. -
ORA-06502 : PL/SQL: numeric or value error in Report formattrigger
Hi guys,
I have a Format Trigger code to not display any amount less than 1.00 at a group frame level and outside of the group frame is the Grand Total in my report but I am getting
" REP-1401: ' r_headerformattrigger ' : Fatal PL/SQL error occurred.
"ORA-06502 : PL/SQL: numeric or value error"
every time I try to run it.
function R_headerFormatTrigger return boolean is
begin
if :c_header_amount_accrual1_disp > 0.99 then
return (TRUE);
else
return (FALSE);
end if;
end;
Does any one have any idea as why?read this code
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 88 to a variable declared NUMBER(2).
Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints
Rizwan -
ORA-06502:Numeric or value error ORA-01403: No data found --6502
Dear All
I am using Forms 10g.
I am calling a report from my form.
but when i am calling then it is showing this error:
ORA-06502:Numeric or value error ORA-01403: No data found --6502
My code is in Print Button :
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
Add_Parameter(PLid, 'P_Block', Text_Parameter, :block_query.item_block);
Add_Parameter(PLid, 'P_Category', Text_Parameter, :block_query.item_category);
Add_Parameter(PLid, 'P_Dept', Text_Parameter, :block_query.item_dept);
Add_Parameter(PLid, 'P_sub_Category', Text_Parameter, :block_query.item_sub_category);
Add_Parameter(PLid, 'P_FLOOR', Text_Parameter, :block_query.item_floor);
Add_Parameter(PLid, 'P_IP', Text_Parameter, :block_query.item_ip);
Add_Parameter(PLid, 'P_Room', Text_Parameter, :block_query.item_room);
Add_Parameter(PLid, 'P_Userid', Text_Parameter, :block_query.item_usr_id);
Add_Parameter(PLid, 'PARAMFORM', Text_Parameter, 'NO');
repid := FIND_REPORT_OBJECT('rp_report');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracleapps_eHOpeAS');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?
'||'server=rep_oracleapps_eHOpeAS');
Exception
When others then
message(Sqlerrm||'-'||sqlcode);
End;
Edited by: Sandip Mohapatra on Feb 8, 2010 12:44 AMhi
u can write for all no problem.
here is an example please modify it with u r requirements.
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
add_parameter(plid,'P_code',text_parameter,to_char(:hr.employee_code));
add_parameter(plid,'P_name',text_parameter,to_char(:hr.name));
add_parameter(plid,'P_fname',text_parameter,to_char(:hr.fname));
add_parameter(plid,'P_gender',text_parameter,to_char(:hr.gender));
add_parameter(plid,'P_married',text_parameter,to_char(:hr.marital_status));
add_parameter(plid,'P_job',text_parameter,to_char(:hr.job));
add_parameter(plid,'P_sal',text_parameter,to_char(:hr.sal));
add_parameter(plid,'P_dob',text_parameter,to_char(:hr.dob));
add_parameter(plid,'P_country',text_parameter,to_char(:hr.country));
add_parameter(plid,'P_nationality',text_parameter,to_char(:hr.nationality));
add_parameter(plid,'P_address',text_parameter,to_char(:hr.address));
add_parameter(plid,'p_imagecode',text_parameter,to_char(:images.employee_code));
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REPORT6');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_APPLICATION_PROPERTY(CURSOR_STYLE,'NORMAL');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
/*Display report in the browser*/
WEB.SHOW_DOCUMENT('http://sarah:8890/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver&P_code='||:hr.employee_code||'&P_name'
||:hr.name ||'&P_fname'|| :hr.fname ||'&P_gender'||:hr.gender||'&P_married'||:hr.marital_status||'&P_job'||:hr.job||'&P_sal'||:hr.sal||'&P_dob'||:hr.dob||
'&p_country'||:hr.country||'&p_natioanlity'||:hr.nationality||'&p_address'||:hr.address||'&p_image'||:images.employee_code||'¶mform=no','_SELF');
END;sarah -
ORA-06502: PL/SQL: numeric or value error: Only in APEX
I have a routine that works well in SQL Plus and Toad.
begin
XXXXXX.process_message(1);
end;
Now when I call it via APEX on a submit of a button, it comes back with an error.
"ORA-06502: PL/SQL: numeric or value error: character to number Error"
Any pointers to what might because this only in APEX and not on toad.
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Prod
PL/SQL Release 10.1.0.5.0 - Production
CORE 10.1.0.5.0 Production
TNS for Linux: Version 10.1.0.5.0 - Production
NLSRTL Version 10.1.0.5.0 - Production
----------------I have updated my profile. I am a development lead at Dell.
The procedure I am calling is calling create service request pub, update service request up.
It is just a wrapper around the all these API's and invoking it from APEX on insert of certain values.
The problem is , this wrapper API works fine with SQL Plus/ TOAD and not via APEX.
I cannot replicate the error in APEX.oracle.com because it is calling custom ebiz code in our 11.5.10 instance. -
-6502 ORA-06502: PL/SQL: numeric or value error when using 'Create CAPI Definition'
I get an error when I try to create a CAPI definition with Headstart untilities (6i). I use HSU_CAPI revision 6.5.2.0
The detailed information says the following:
Message
BLAPI.OPEN_ACTIVITY
Start HSU_CAPI.run
Number of Tables to create CAPI for 1
Initial checks for table KCS_TENDERS with id 692754610572409851363604771392473242
HSU_CAPT.initial_checks for table KCS_TENDERS
HSU_CAPF.initial_checks for table KCS_TENDERS
HSU_CAPC.initial_checks Custom Services for table KCS_TENDERS
HSU_CAPB.initial_checks BRDD for table KCS_TENDERS
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDIPLS
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
KCS_TENDERS Business Rule Design Definition BR_TNR001_CEV does not have any Trigger Columns. Rule will fire when any column is updated.
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDIPLS
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
Creating CAPI for table KCS_TENDERS with id 692754610572409851363604771392473242
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Insert-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Update-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Insert-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Update-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Delete-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-row, Save old data.
Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCODE number of text lines = 404 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Insert, Call CAPI.
Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCODE number of text lines = 4 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Update, Call CAPI.
Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCODE number of text lines = 4 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Delete, Call CAPI.
Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCODE number of text lines = 17 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Insert, Call CAPI.
Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCODE number of text lines = 7 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Update, Call CAPI.
Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCODE number of text lines = 144 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Delete, Call CAPI.
Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCODE number of text lines = 282 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
HSU_CAPF.create_or_find_capi_pack
hsu_capi.find_plm (kcs_tnr_capi, 692754610572409851363604771392473242, CAPI).
capi package found in the context folder
BLPLM.UPD
FREE_FORMAT_TEXT_FLAG......... = Y
IMPLEMENTATION_NAME........... = kcs_tnr_capi
PLSQL_MODULE_TYPE............. = PACKAGE
SCOPE......................... = PUBLIC
COMPLETION_STATUS............. = COMPLETED
NAME.......................... = kcs_tnr_capi
PURPOSE....................... = Custom API package for implementing Business Rules and supporting TAPI
Recreated Package KCS/ KCS_TNR_CAPI, preserving only the Revision History.
HSU_CAPF.add_tags_er_av
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
HSU_CAPF.create_specification
HSU_CAPF.create_c_tabalias
HSU_CAPF.create_c_tabalias_all
HSU_CAPF.create_aggregate_value
HSU_CAPF.create_aggregate_value
HSU_CAPF.create_aggregate_value
Activity aborted with ORACLE internal errors.
-6502 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
What can I do about it???
Thanks in advance.
Menno HoogsteenWorking on the same project as Menno, I had the time to look into the problem.
The problem is caused by the creation of the capi-function agregate_char_value in the packages hsu_capf. While creating this function the following code is executed:
add(' -- allowable values:');
add(' -- '||l_col_name_list);
This last statement causes the problem because this table is very big. L_col_name_list contains 2391 characters wich is 393 characters to long. So i changed this code into:
add(' -- allowable values:');
add(' -- '||substr(l_col_name_list,1,1990));
add(' -- '||substr(l_col_name_list,1990));
and everything works fine. Perhaps something for a patch?
Kind regards,
Ruben Spekle -
Hi,
Can anyone let me know what is the issue on below code and how can we avoid that? i am getting the error like below
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
v_while_loop := 1;
v_delete_char_id := v_tabtype_result_values.FIRST;
WHILE v_while_loop <> v_tabtype_result_values.COUNT
LOOP
IF check_duplicate_nc_data (v_result_view,
v_tabtype_result_values(v_delete_char_id).value,
v_collection_id,
v_occurrence,
v_plan_id,
v_delete_char_id
THEN
DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
v_tabtype_result_values.DELETE(v_delete_char_id);
ELSE
DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
||v_tabtype_result_values(v_delete_char_id).value||','
||v_tabtype_result_values(v_delete_char_id).validation_flag
END IF;
v_while_loop := v_while_loop + 1;
v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
END LOOP;Change:
WHILE v_while_loop <> v_tabtype_result_values.COUNT to
WHILE v_while_loop <= v_tabtype_result_values.LASTSY. -
Error ORA-06502, numeric or value error character to number conversion
I have been trying to create an email including data from a table as part of the body. Whenever I try to send it, I get an error ORA-06502, numeric or value error, character to number conversion. If I take out the part referencing the table, the email will go without error, but if I put it back in I get the error.
There is the code:
DECLARE
v_email_body CLOB;
v_from_email_address VARCHAR2(100) := v('APP_USER');
v_id NUMBER;
BEGIN
v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
Date: '||:P14_PURCHASE_DATE||'
Vendor: '||:P14_VENDOR||'
Invoice Number: '||:P14_INVOICE||'
Invoice Date: '||:P14_INVOICE_DT||'
Due Date: '||:P14_INVOICE_DUE_DT||'
KSR Number: '||:P14_KSR||'
DTS PO: '||:P14_DTS_PO||'
FINANCE DO: '||:P14_FINANCE_PO||'
FOR detail IN(SELECT OB_CODE
FROM BUDGET_USED
WHERE P_ID = :P14_ID)
v_email_body := v_email_body||detail.OB_CODE||utl_tcp.crlf;
LOOP
FOR detail2 IN (SELECT ob_code, amount
FROM budget_used
WHERE p_id = :P14_ID)
LOOP
v_email_body := v_email_body||detail2.ELCID||' - '||detail2.AMOUNT||utl_tcp.crlf;
END LOOP;
END LOOP;
v_email_body := v_email_body
'||:P14_EMAIL_NOTES||'
Thanks.
v_id := APEX_MAIL.SEND
(p_to => :P14_SUBMIT_TO
,p_cc => v('APP_USER')
,p_bcc => '[email protected]'
,p_from => v_from_email_address
,p_body => v_email_body
,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
--Having set up your email, now add one (or more) attachments...
FOR c1 in (SELECT FILENAME
,BLOB_CONTENT
,MIME_TYPE
FROM file_subjects f, apex_application_files a
where a.name = f.name
and f.P_ID = :P14_ID) LOOP
IF c1.blob_content IS NOT NULL THEN
APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
p_attachment => c1.blob_content,
p_filename => c1.filename,
p_mime_type => c1.mime_type);
END IF;
END LOOP;
END;
Apex_mail.push_queue();
This is important to my company to be able to put this data into an email. If anyone can help me, I would greatly appreciate it. Thank you in advance.Lets isolate the erroring line by running the code in debug mode and adding some debug lines at various stages in the code
Apex has a builtin function named wwv_flow.debug which can print messages to the debug stack and would be visible when the page is run in debug mode.
DECLARE
v_email_body CLOB;
v_from_email_address VARCHAR2(100) := v('APP_USER');
v_id NUMBER;
BEGIN
wwv_flow.debug('BEGIN');
v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
Date: '||:P14_PURCHASE_DATE||'
Vendor: '||:P14_VENDOR||'
Invoice Number: '||:P14_INVOICE||'
Invoice Date: '||:P14_INVOICE_DT||'
Due Date: '||:P14_INVOICE_DUE_DT||'
KSR Number: '||:P14_KSR||'
DTS PO: '||:P14_DTS_PO||'
FINANCE DO: '||:P14_FINANCE_PO||'
'||:P14_EMAIL_NOTES||'
Thanks.
wwv_flow.debug('Before sending mail');
v_id := APEX_MAIL.SEND
(p_to => :P14_SUBMIT_TO
,p_cc => v('APP_USER')
,p_bcc => '[email protected]'
,p_from => v_from_email_address
,p_body => v_email_body
,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
wwv_flow.debug('Before attachements');
--Having set up your email, now add one (or more) attachments...
FOR c1 in
(SELECT FILENAME
,BLOB_CONTENT
,MIME_TYPE
FROM file_subjects f, apex_application_files a
where a.name = f.name
and f.P_ID = :P14_ID)
LOOP
IF c1.blob_content IS NOT NULL THEN
APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
p_attachment => c1.blob_content,
p_filename => c1.filename,
p_mime_type => c1.mime_type);
END IF;
END LOOP;
wwv_flow.debug('Finished attachements');
Apex_mail.push_queue();
END;What is the last message you see in the debug after running the page in debug mode and submitting it ?
Maybe you are looking for
-
Jquery content not working after the updates from firefox
Hi, i've realized that some of my website's banner is not working after the recent updates from firefox, whereas those website's banner is working in google chrome. Hope there is a solution for this as i'm using the firefox for years and wish this is
-
How to distribute a form with multiple submit buttons?
I have a form that has multiple submit buttons depending on the information that is being entered and then who the information should go to. When I try to disbribute the form, I get an error message stating the following, "Acrobat is unable to distr
-
How to remove the worksets from the Top level navigation for the ESS role.
Hi All, I am working on enabling and disabling certain services in the ESS worksets. we are using EP 7.0, ECC 6.0 (NW2004s). When I login as a user with ESS role, I can view the changes in the overview pages. However, the worksets are still visible i
-
Executing a mapping from sqlplus in OWB 904
I have used the below syntax to execute OWB 902 mappings as below: sqlplus / <<*sql* Execute MAP_SOMETHING.MAIN(); sql I deployed the same mapping with new version of OWB 904.. it did not work. What is new syntax to execute the mapping from sqlplus?
-
Request: tag each script run
Since each time you execute a script it outputs to the same log window, and sometimes you have to run a script multiple times (e.g. while debugging it), it would be useful to preface each run with some sort of divider: == Script run at 10:04 AM PST =