Clearing of numeric varible value in plng folder.
hi friends,
i'm using 2 numeric varibles.
For both of them replacement type is User-defined value and tick marked "INput allowed by user".
User enters values in numberic varibles(selections) in plng folder and runs plng funciton, then output comes perfectly.
when next time user enters that plng folder again, he is viewing same selections(for both varibles) made earlier in previous run.
Even though user tryging to change them, system not allowing to change to new values. My requirement is just clearing of variable values(last run), when before any user runs plng folder.
Or In other way, when user runs plng folder, upon seeing output and saving plng figures to database, and i required here just clearing of that two numeric variable values.
How can i achieve this objective?
thanks,
kumar
Remove numeric value(by cut option, upon right click) on char variable and enter new value. After that save content.
Issue resolved.
Similar Messages
-
Plng folder: user inputs has to save automatically,before plng function exe
hI friends,
at plng folder level, user enters selections(varibles area) and input values in input area. Next runs plng funciton, which do some calculation at background(formula function) and showed results in output layout.
Can i make user entered variable values & input values automatically save, when user clicks plng function? Here if we not provide this provision, user has to save both varibles values & input values before running plng function.
thanks,
kumar .If you are doing this in BPS then refer to the following thread and how to paper.
Re: Automatic save function in planning folders
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e032e790-0201-0010-8bae-f9bc2b1e5aaa?overridelayout=true -
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. -
Package Returning Error ORA-06502: PL/SQL: numeric or value error
Hi,
I create a package to export to spread sheet .xls, The package work for simple query if i pass the query to package.
There is no error in package please create the package and do the following as mentioned below
create or replace
PACKAGE export_pkg_spread_sheet
AS
procedure download_excel(vsql in clob );
PROCEDURE excel_header(p_header in out nocopy clob);
procedure excel_content(p_content in out nocopy clob,
vsql in clob );
procedure excel_footer(p_footer in out nocopy clob);
procedure get_usable_sql (p_sql_in IN clob,
p_sql_out OUT clob);
END export_pkg_spread_sheet;
create or replace
PACKAGE body export_pkg_spread_sheet
AS
PROCEDURE excel_header (p_header IN OUT nocopy CLOB)
AS
BEGIN
p_header := '<html><body>';
END;
procedure download_excel( vsql in clob )
as
p_header clob;
p_footer clob;
p_content clob;
begin
owa_util.mime_header( 'application/octet', FALSE );
htp.p('Content-Disposition: attachment; filename="report.xls"');
owa_util.http_header_close;
excel_header( p_header);
excel_content(p_content,vsql);
excel_footer(p_footer);
dbms_output.put_line(p_header ||p_content|| p_footer);
HTP.PRN( p_header ||p_content|| p_footer);
htmldb_application.g_unrecoverable_error := true;
end;
procedure excel_content(p_content in out nocopy clob,
vsql in clob)
as
p_sql_stmt clob;
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
TYPE varColumn IS TABLE OF varchar2(32000);
vtab varColumn;
v_column_count NUMBER DEFAULT 0;
v_status INTEGER;
BEGIN
htp.prn('am here');
/* SELECT region_source into p_sql_stmt
FROM apex_application_page_regions
WHERE region_id = p_region_id AND
page_id = p_page_id AND
application_id = p_app_id; */
get_usable_sql (vsql,p_sql_stmt);
p_content := p_sql_stmt;
-- Parse the query.
DBMS_SQL.PARSE(cur, p_sql_stmt , DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
p_content := '<table> <tr>';
FOR colind IN 1 .. ncols
LOOP
p_content := p_content || '<td>' || cols(colind).col_name || '</td>';
END LOOP;
p_content := p_content || '</tr>';
vtab := varColumn(null);
for i in 1..ncols
loop
vtab.extend;
DBMS_SQL.DEFINE_COLUMN (cur, i, vtab(i), 2000);
--dbms_output.put_line(vtab(i));
end loop;
v_status := DBMS_SQL.EXECUTE (cur);
LOOP
p_content := p_content || '<tr>';
EXIT WHEN (DBMS_SQL.FETCH_ROWS (cur) <= 0);
FOR i IN 1 ..ncols
loop
DBMS_SQL.COLUMN_VALUE (cur, i, vtab(i));
-- p_content := p_content || '<td>' || 'xyz' || '</td>';
p_content := p_content || '<td>' || vtab(i) || '</td>';
END LOOP;
p_content := p_content || '</tr>' ;
END LOOP;
p_content := p_content || '<table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
exception
when others then
p_content := '<td>Exception Error in printing data</td><table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
end;
procedure excel_footer( p_footer in out nocopy clob)
as
begin
p_footer := '</body></html>';
end;
PROCEDURE get_usable_sql (p_sql_in IN clob, p_sql_out OUT clob)
IS
v_sql clob;
v_names DBMS_SQL.varchar2_table;
v_pos NUMBER;
v_length NUMBER;
v_exit NUMBER;
BEGIN
v_sql := p_sql_in;
v_names := wwv_flow_utilities.get_binds (v_sql);
FOR i IN 1 .. v_names.COUNT
LOOP
<<do_it_again>>
v_pos := INSTR (LOWER (v_sql), LOWER (v_names (i)));
v_length := LENGTH (LOWER (v_names (i)));
v_sql :=
SUBSTR (v_sql, 1, v_pos - 1)
|| v_names (i)
|| SUBSTR (v_sql, v_pos + v_length);
v_sql :=
REPLACE (v_sql,
UPPER (v_names (i)),
'(SELECT v('''
|| LTRIM (v_names (i), ':')
|| ''') FROM DUAL)'
IF INSTR (LOWER (v_sql), LOWER (v_names (i))) > 0
THEN
GOTO do_it_again;
END IF;
END LOOP;
p_sql_out := v_sql;
END;
END export_pkg_spread_sheet;
After creating the package pass the parameter to package like this
begin
export_pkg_spread_sheet.download_excel('select * from emp');
end;
Package will allow to download the spread shreet. If i try to pass the a complex query to package it is returning error as mentioned below
ORA-06502: PL/SQL: numeric or value error
In the above package there is a procedure called procedure excel_content which actuall prints the data in the spread sheet this is where the error is coming from there is a variable called vsql have declared it as clob to hold large string but still i am getting the same error when trying to pass a big string.
Please check the error and let me know.
Thanks
SudhirHi Praveen,
This is the query i am using to pass
Declare
qry clob;
Begin
qry := ' 'SELECT
AR.REGION_CODE,
AR.DISTRICT_CODE,
AR.TERRITORY_CODE,
CASE
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.REGION_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.DISTRICT_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NOT NULL THEN
AR.TERRITORY_NAME
END TERR_NAME,
AR.EMPLOYEE_ID,
AR.LAST_NAME,
AR.FIRST_NAME,
AR.GENDER,
AR.DATE_OF_HIRE,
AR.PROJECT_EMPLOYEE_TITLE_ID,
AR.COMPANY_ID,
AR.CUSTOMER_EMAIL,
AR.BUSINESS_EMAIL,
AR.CUSTOMER_VOICEMAIL,
AR.CUSTOMER_VOICEMAIL_EXT,
AR.QUINTILES_VOICEMAIL,
AR.QUINTILES_VOICEMAIL_EXT , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ZipCode" FROM AR_V_ROSTER AR
LEFT JOIN AR_V_ADDRESS_HISTORY AAH
ON
(AR.PROJECT_ID = AAH.PROJECT_ID AND
AR.EMPLOYEE_ID = AAH.EMPLOYEE_ID)
WHERE
UPPER(AR.USER_EMPLOYEE_ID) = ''Q766730'' AND
AR.PROJECT_ID = 81 ';
export_pkg_spread_sheet.download_excel(qry);
End;
Praveen you can pass your DB table query to check the error. I am trying to pass as mentioned above.
Please let me know if my question is not clear.
Thanks
Sudhir -
-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 -
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 -
This is driving me nuts!
I am getting this error from OWB during a mapping process.
I have checked the input data and it looks fine.
The run time audit browser just lists all of the steps but does not make it clear which one failed. Is it the last one which is shown (does not have HIDE as selection link.)
I also tried to determine which row was causing the problem and followed the instructions at http://www.nicholasgoodman.com/bt/blog/2005/07/, but no row_id was recorded in the views. In actual fact there wasn't very much audit info other than that the mapping ran and was complete (even though it failed).
In the error message section it has, in order
Map Step - blank
Rowkey - 35204435256
Severity - X
Error Message - ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
Object Name - N/A
Object Column - *
From the PL/SQL error I thought it may be trying to insert into a data field that was too small, but all of the columns that are used are full of data of length shorter than all of the target tables.
I have even started running the cursors in the generated PLSQL but I don't get the error by doing this.
Thanks in advance for any tips at all.Thanks for the response.
I managed to work it out and it had to do with the selection criteria of one of the filters.
For anyone else facing this error, check to see if any of the rows being inserted has the same key/identifier as some existing in the target table. If so add an extra condition to the where clause.
This worked for me. -
Error at Script Editor - ORA-06502: PL/SQL: numeric or value error
Hello everyone,
This is my last call for help. I have made some research before i decided to create this thread, trying to find similar problems on the web and on this forum but it seems that this kind of error is associated with another type of situations. In addition, i am pretty new to Oracle DBMS and i do not know how to figure out some problems that happens in this DBMS. This one is very ridiculous because it happens when i load or create a script in Oracle Script Editor. This might be a bug for Oracle Developers figure out and correct for the next releases or updates (or not..).
Working on:
Oracle Database 10g Express Edition (Fresh installation - Yesterday)
Application Express 2.1.0.00.39 (Might be useful information) Windows XP
Problem:
I have a script which allows to create a new database with some tables, relations and data filled in. I go to DB Homepage and login, go to Script Scripts menu and upload the script. I open the script to run it and when the Script Editor load it shows this: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
<table style="display:none;position:absolute;background-color:#EEEEEE;border:#000000 solid 1px;padding:0px;text-align:center;font-size:12px;color:#000000;" summary="" cellpadding="0" cellspacing="0" border="0" id="R138352509674476936">
<tr>
<td class="htmldbWizardHeader">Save Script</td>
<td class="htmldbWizardHeader" align="right"><span><img src="/i/qb/vertical_close.png">
</span></td>
</tr>
<tr>
<td colspan="2" class="htmldbWizardBody">
<div id="saveDialog">A script with this name already exists. Do you wish to overwrite it?</div>
<table summary="" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="right"><input type="button" value="Cancel" class="htmldbButton">
<input type="button" value="Yes" class="htmldbButton">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="right">???</td>
</tr>
</table>
<table summary="">
<tr>
<td></td>
<td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="11141129549203626">
<input type="hidden" name="p_t09" value="" id="OB_OBJECT_NAME">
</td>
<td></td>
<td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="11143605700225196">
<input type="hidden" name="p_t10" value="" id="P0_PPRTIMESTAMP">
</td>
<td width="15">
<div style="width:15px"><br>
</div>
</td>
<td id="htmldbRegion3" class="htmldbTDRight" width="100%" valign="top"></td>
</tr>
</table>
<div id="htmldbRegion4"></div>
<div class="htmldbFlowV">Application Express 2.1.0.00.39</div>
<div class="htmldbNewBottom">
<div class="htmldbNewBottom1">Language: pt</div>
<div class="htmldbNewBottom2">Copyright ? 1999, 2006, Oracle. All rights reserved.</div>
<br style="clear:both;">
</div>
<form><input type="hidden" name="p_md5_checksum" value="">
</form>
<a name="END"><br>
</a> <script language="JavaScript1.1" type="text/javascript">
first_field('P60_SCRIPT_NAME');
</script> The first line seems to be the error: boldORA-06502: PL/SQL: numeric or value error: character string buffer too small*bold*.
However i don't understand why shows the HTML code. Seems to be the code related with the rest of the Oracle DB webpage where the script in filled in (check this two images to understand what i am trying to say: http://img146.imageshack.us/img146/3104/errororacle10g.jpg and http://img180.imageshack.us/img180/5185/scripteditornormal10g.jpg. This is what Script Editor shows on Internet Explorer.
If i login and make the same in another browser the behavior is different. In Firefox the script editor don't show anything and with Chrome i get all the script instructions in a single line (it exceeds the Script Editor) and the Script Editor background turns red: http://img812.imageshack.us/img812/1382/oracleerrorchrome.jpg I tested some scenarios and i got other conclusions: When i try to create a script in the Script Editor, whatever i write (instructions or whatever) when i save and load the file shows the same error. I uploaded the script many times with different File Character Set and the error shows in all situations.
Edited by: 806529 on Nov 1, 2010 3:38 AM
Edited by: 806529 on Nov 1, 2010 3:42 AM
Edited by: 806529 on Nov 1, 2010 3:42 AMThe script that i am trying to run is this: (I think the script is not relevant because many class mates can upload and run it successfully on their Oracle Express 10g installed on Windows 7 or XP)
drop table alunos cascade constraints;
create table alunos (alu_id number(10) not null,
alu_nome varchar2(60) not null,
alu_local varchar2(30),
alu_dnsc date not null,
alu_sexo char(1) not null,
alu_email varchar2(30),
alu_cur_id number(10));
drop table cursos cascade constraints;
create table cursos (cur_id number(10) not null,
cur_nome varchar2(40) not null);
drop table departamentos cascade constraints;
create table departamentos (dep_id number(10) not null,
dep_nome varchar2(60) not null,
dep_sigla char(3) not null);
drop table disciplinas cascade constraints;
create table disciplinas (dis_id number(10) not null,
dis_nome varchar2(40) not null,
dis_creditos number(1) not null,
dis_dep_id number(10));
drop table planoestudos cascade constraints;
create table planoestudos (pla_cur_id number(10) not null,
pla_dis_id number(10) not null,
pla_semestre number(1) not null);
drop table inscricoes cascade constraints;
create table inscricoes (ins_id number(10) not null,
ins_alu_id number(10) not null,
ins_pla_cur_id number(10) not null,
ins_pla_dis_id number(10) not null,
ins_dt_inscricao date not null,
ins_dt_avaliacao date,
ins_nota number(4,2) );
-- Chaves primárias
alter table alunos add constraint pk_alunos primary key (alu_id);
alter table cursos add constraint pk_cursos primary key (cur_id);
alter table departamentos add constraint pk_departamentos primary key (dep_id);
alter table disciplinas add constraint pk_disciplinas primary key (dis_id);
alter table planoestudos add constraint pk_planosestudos primary key (pla_cur_id, pla_dis_id);
alter table inscricoes add constraint inscricoes_pk
primary key (ins_id);
-- Chaves estrangeiras
alter table alunos add constraint alunos_fk_cursos
foreign key (alu_cur_id) references cursos(cur_id);
alter table disciplinas add constraint disciplinas_fk_departamentos
foreign key (dis_dep_id) references departamentos(dep_id);
alter table planoestudos add constraint planoestudos_fk_cursos
foreign key (pla_cur_id) references cursos(cur_id);
alter table planoestudos add constraint planoestudos_fk_disciplinas
foreign key (pla_dis_id) references disciplinas(dis_id);
alter table inscricoes add constraint inscricoes_fk_alunos
foreign key (ins_alu_id) references alunos(alu_id);
alter table inscricoes add constraint inscricoes_fk_planoestudos
foreign key (ins_pla_cur_id,ins_pla_dis_id) references planoestudos(pla_cur_id,pla_dis_id);
-- Sequências
drop sequence seq_alunos;
create sequence seq_alunos increment by 1 start with 1;
drop sequence seq_cursos;
create sequence seq_cursos increment by 1 start with 1;
drop sequence seq_disciplinas;
create sequence seq_disciplinas increment by 1 start with 1;
drop sequence seq_departamentos;
create sequence seq_departamentos increment by 1 start with 1;
-- Informação
insert into cursos values(seq_cursos.nextval,'Engenharia Biomédica');
insert into cursos values(seq_cursos.nextval,'Engenharia Informática');
insert into cursos values(seq_cursos.nextval,'Engenharia Electrónica e Computadores');
insert into cursos values(seq_cursos.nextval,'Engenharia do Ambiente');
insert into alunos values(seq_alunos.nextval,'Joaquim Pires Lopes','lisboa',to_date('85.01.01','YY.MM.DD'),'M','[email protected]',2);
insert into alunos values(seq_alunos.nextval,'Ana Maria Fonseca','Setúbal',to_date('87.03.03','YY.MM.DD'),'F','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'Paula Antunes','Lisboa',to_date('86.07.06','YY.MM.DD'),'F',null,2);
insert into alunos values(seq_alunos.nextval,'Joana Ramalho Silva','Costa da Caparica',to_date('84.09.23','YY.MM.DD'),'F','[email protected]',3);
insert into alunos values(seq_alunos.nextval,'Rui Manuel Silva','Cascais',to_date('84.08.15','YY.MM.DD'),'M','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'João Paulo Santos','Lisboa',to_date('81.11.16','YY.MM.DD'),'M','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'Cristina Fernandes Lopes','Lisboa',to_date('86.01.07','YY.MM.DD'),'F',null,1);
insert into alunos values(seq_alunos.nextval,'Miguel Pinto Leite','Cascais',to_date('74.01.07','YY.MM.DD'),'M','[email protected]',3);
insert into alunos values(seq_alunos.nextval,'Francisco Costa Rosa',null,to_date('78.02.16','YY.MM.DD'),'M',null,4);
insert into alunos values(seq_alunos.nextval,'Elsa Fialho Pinto','Palmela',to_date('79.10.29','YY.MM.DD'),'F','[email protected]',1);
insert into departamentos values(seq_departamentos.nextval,'Departamento de Sistemas e Informática','DSI');
insert into departamentos values(seq_departamentos.nextval,'Departamento de Engenharia Electrotécnica', 'DEE');
insert into departamentos values(seq_departamentos.nextval,'Departamento de Matemática','DEM');
insert into disciplinas values(seq_disciplinas.nextval,'Introducao a Programacao',4,1);
insert into disciplinas values(seq_disciplinas.nextval,'Inteligência Artificial',3,1);
insert into disciplinas values(seq_disciplinas.nextval,'Redes de Computadores',2,1);
insert into disciplinas values(seq_disciplinas.nextval,'Base de Dados',6,1);
insert into disciplinas values(seq_disciplinas.nextval,'Complementos de Base de Dados',2,1);
insert into disciplinas values(seq_disciplinas.nextval,'Análise de Sistemas',1,1);
insert into disciplinas values(seq_disciplinas.nextval,'Sistemas Distribuídos',1,1);
insert into disciplinas values(seq_disciplinas.nextval,'Sistemas Digitais',3,2);
insert into disciplinas values(seq_disciplinas.nextval,'Microprocessadores',2 ,2);
insert into disciplinas values(seq_disciplinas.nextval,'Electrónica Geral',3,2);
insert into disciplinas values(seq_disciplinas.nextval,'Análise Matemática I',4,3);
insert into disciplinas values(seq_disciplinas.nextval,'Análise Matemática II',4,3);
insert into disciplinas values(seq_disciplinas.nextval,'Aplicações Multimédia',6,1);
insert into planoestudos values(1,1,1);
insert into planoestudos values(1,2,4);
insert into planoestudos values(1,3,4);
insert into planoestudos values(1,4,3);
insert into planoestudos values(1,5,5);
insert into planoestudos values(1,6,2);
insert into planoestudos values(1,7,5);
insert into planoestudos values(1,8,6);
insert into planoestudos values(1,11,1);
insert into planoestudos values(2,1,1);
insert into planoestudos values(2,4,5);
insert into planoestudos values(2,8,3);
insert into planoestudos values(2,9,2);
insert into planoestudos values(2,10,1);
insert into planoestudos values(2,11,3);
insert into planoestudos values(3,1,3);
insert into planoestudos values(3,11,4);
insert into planoestudos values(3,12,5);
insert into planoestudos values(4,1,3);
insert into planoestudos values(4,4,4);
insert into planoestudos values(4,11,4);
insert into planoestudos values(4,12,5);
insert into inscricoes values(1,1,2,1,TO_DATE('3-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),10);
insert into inscricoes values(2,1,2,8,TO_DATE('5-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(3,1,2,9,TO_DATE('6-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(4,2,1,1,TO_DATE('23-SEP-2000','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),11);
insert into inscricoes values(5,2,1,11,TO_DATE('23-SEP-2000','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-MAR-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(6,2,1,4,TO_DATE('5-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(7,3,2,1,TO_DATE('5-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),12);
insert into inscricoes values(8,3,2,9,TO_DATE('6-SEP-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(9,4,3,12,TO_DATE('5-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-MAR-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),10);
insert into inscricoes values(10,5,1,1,TO_DATE('7-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(11,6,1,1,TO_DATE('23-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(12,6,1,11,TO_DATE('23-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(13,7,1,1,TO_DATE('8-SEP-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('10-FEB-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(14,7,1,11,TO_DATE('8-SEP-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('7-MAR-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),17);
insert into inscricoes values(15,7,1,4,TO_DATE('5-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-JUL-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),15);
insert into inscricoes values(16,7,1,2,TO_DATE('5-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-MAR-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(17,8,3,12,TO_DATE('11-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-MAR-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),14);
insert into inscricoes values(18,9,4,1,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(19,9,4,11,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(20,9,4,12,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(21,10,1,11,TO_DATE('11-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-FEB-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),15);
insert into inscricoes values(22,10,1,1,TO_DATE('12-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),12);~
commit; -
Custom message(low stock) on alv layout cell(plng folder)
hi friends,
in plng folder(alv layout), can system displays message dynamically on a particular cell(row & col combination). eg: "low stock" via fox code. Simply i 'm deriving one cell value based on fox code (formula). If stock > 0, show stock value, else in that cell i want "low stock".
In excel , this facility is availble using "IF', formula on particular cell.
thanksHi Raju,
what you could do is:
- define a new calculated keyfigure which takes the stock value if it is > 0 and the value 0 in all other cases.
- define your query setting View->Properties->Value Display->Zero value display->show zero values to "low stock".
This has a similar effect. All value which are 0 in the query are displayed as text "low stock". Another option to highlight "low stock" material would be using exceptions.
Maybe this fulfills your requierement. Binding messages raised in planning function to certain cells in excel is not possible.
Regards Matthias Nutt
SAP Consulting Switzerland -
Document list(Plng folder)
Hi Friends,
Maintained reference document list at plng environment and then included at plng folder(design mode). Assignment everything is Ok. While excuting plng folder, system prompts error message: Error in DOC001, layout is incorrect or deleted and then proceeded further, i'm able to view that document list perfeclty. Why i'm getting error message? There is no help given by SAP at prompt message window.
Is there any method of uploading excel file data to planning layouts/planning folder fields through interfaces.
thanks,
RPMaintained reference document list at plng environment and then included at plng folder(design mode). Assignment(chars,calmonth,& keyfigure:not entered any value) is Ok. While excuting plng folder, system prompts error message: Error in DOC001, layout is incorrect or deleted and then proceeded further(pressed continue button), i'm able to view that document list perfeclty. Why i'm getting error message in window? There is no help given by SAP at prompt message window logs.
regards,.. -
APEX Validation : ORA-06502: PL/SQL: numeric or value error:
Hello,
I need some help for a validation. User put value at 'minutes field'(need a number between 0-59).
My solution is to make two validations:
1 - No number:
Name: P1_MINUTES
Type : Regular expression
Validation Expression 1: P1_MINUTES
Validation Expression 2: ^\d{1,5}(\.\d{1,2})?$
2 - Higher number then 59:
Name: P1_MINUTES
Type : Function returning Boolean
Validation Expression 1:
if :P10_TOT_MINUTEN < 60 then
return true;
else
return false;
end if;
Validation Expression 2: -
Validation 2 gives this error(for example value = m) :
ORA-06502: PL/SQL: numeric or value error: character to number conversion error - the reason is clear value m is not numeric
How can this be solved!Tony,
This is not the solution for my problem. If the user fills a character (say 'b') then I have still this error. Value 'b' is not numeric.
I need a solution: Combination from both validations or skip function (if validation number 1 is true then skip validation 2).
Do you have another solution for this problem.
Thanks
Walter -
Problem with error ORA-06502: PL/SQL: numeric or value error string
Hi,
I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
ORA-06502: PL/SQL: numeric or value error stringSD wrote:
Hi,
I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
ORA-06502: PL/SQL: numeric or value error stringyes, it is a data dependent error.
Handle: SD
Status Level: Newbie
Registered: Nov 21, 2001
Total Posts: 289
Total Questions: 189 (183 unresolved)
why do you waste time here when you rarely get your questions answered? -
Hi I have a Sql Query Report Region as defined below. On the report attributes I am not using any "Row Selector". In a After submit process I try to print out the results of the value I have entered in as a value in updatable report and i get the error: I am doing this as a test before i use the data to insert into another table...
I receive this error if I enter in a characters (not numeric) into the "Field Value" field.:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error.
If I enter in a numeric into the "Field Value" text box, then I get the value displayed back without error. I need to be able to enter a varchar value without error.
My SQL QUERY is:
select i.INDEXED_FIELD_ID, i.field_name,
HTMLDB_ITEM.TEXT(3,d.indexed_field_value) field_value,
decode(f.required, 0, 'O', 1, 'R', 'NOT USED') REQUIRED
from XXVG_EFILE_DOCUMENT_FIELDS D,
xxvg_efile_type_fields f, xxvg_efile_indexed_fields i
WHERE f.indexed_field_id = i.indexed_field_id
and f.required in (0,1)
and i.indexed_field_id = d.indexed_field_id(+)
and d.document_id(+) = -1
and f.document_type_id = :p21_doc_type
My after submit process is the following...**Note** I am using P21_test as a field just to display my test. I receive the value back just fine without error if numeric. If varchar, that is when the problems occur. I have used just a length variable like the lettter 't' for testing and still receive the error.
DECLARE
vRow BINARY_INTEGER;
BEGIN
-- update field values
FOR i IN 1 .. HTMLDB_APPLICATION.g_f03.COUNT -- your field value
LOOP
vRow := HTMLDB_APPLICATION.g_f03(i);
IF vRow is Not NULL --means the field has data in it.
THEN
:p21_test := HTMLDB_APPLICATION.G_F03(i); --set a variable to the field with data.
END IF;
END LOOP;
END;
Is there a conversion I need to do? I do not want to do this via checkboxes as I dont want the user have to check a checkbox and then enter a value in. I just want a blank text box the user can enter a value in and then i can do an insert.
Thanks So much.Thanks Scott, That did do the trick as the varchar is now displayed of the entered item.
How do i also display the value of indexed_field_id as well.
I have an insert where i need the indexed field id and the entered field value.
Thanks in advance. -
I have a form which uses a customer form/report, drop downs etc..
the debug shows it running this statement
...Execute Statement: begin begin SELECT distinct initcap(RTRIM (LTRIM (e.surname, ' *0123456789-/:.?,'), ' *0123456789-/:.?,') || ', ' || RTRIM (LTRIM (e.first_name, ' *0123456789-/:.?,'), ' *0123456789-/:.?,' )) empname, e.ID bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value FROM dms.dms_employees@dmsprd e, dms.dms_employee_contracts@dmsprd ec WHERE e.ID = ec.emp_id and e.surname like '%%' AND :p75_date BETWEEN ec.start_date AND NVL (ec.end_date, :p75_date) AND e.brh_id = 3654 ORDER BY 1; end; end;
Then says
"report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small"
Any Ideas?
Thanks
DeanDenes Kubicek wrote:
A select list is limited in size. I am not sure what the limit is but that is definitelly the case.The maximum size for the HTML generated for a select list is 32K.
86 options sounds on the low side to be hitting that limit, but there are other concerns to this as well. Scrolling through hundreds/thousands of options in a select list is a pain for users, and huge select lists produce bloated pages that impact load times and network bandwidth. That list of around 200 countries you find on many sites is about the sensible maximum length for a select list.
You should use popups.Indeed. -
The oracle application express environment is created by installing the HTTP Server on the windows server and the application express 3.2.1 components on the 11.1.0.7 oracle database on UNIX. The installation is successfully and have not seen any issues during the installation. After completing all the steps, when tried to login and click the application builder or workspace components, I see the error message
report error:ORA-06502: PL/SQL: numeric or value error: character to number.
This error message is seen on most of the pages when trying to accessed and not able to understand the reasons behind it. Its a brand new environment setup and not even presented to developers to test it.
Below error message is always seen when trying to access most of the components like application builder, schema comparison and some other tabs. Please advice
report error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Edited by: user589320 on Jun 9, 2011 5:17 PMI think its better you use APEX 4.x version ratherthan using old version.
You will get more features and some bug fixes and also it's easy for you to get some help when you need.
* If this answer is helpfull or correct then please mark it and grant the points.
Maybe you are looking for
-
ITunes won't open, but there are no error messages
Hi, I just downloaded iTunes 6.04 and now it won't open when I click on the icon on the desktop or try to open it through programs. No error messages were given. It simply won't open. Thank you for your help. Martin Pittman
-
How do you stop airtunes dropping out with AEX/Extreme bridged airports?
I finally found out how to get my Airports networked so that I could use the internet and airtunes to work at the same time, only now neither works well. The connection to my speakers cuts out every few minutes, simultaneously disconnecting from the
-
Any help would be greatly appreciated
-
E71 GPS Stopped Working After 3.03 (10wk11) Instal...
Had I known attempting this Map update would blow out my GPS, I wouldn't have done it. My current software version in my Straight Talk E71 is 500.21.009. I am a Mac user. I downloaded this file in hopes of updating my GPS Map software: nokia_maps_3
-
ITunes no longer sees my ipod at all...constantly slowly flashes orange
Quite odd this...ipod shows up under 'about this mac' as being plugged into a usb plug, but iTunes 8.02 just won't see it. Also the ipod constantly flashes a slow orange. The ipod actually plays the songs that are on it...I just cant get itunes to ed