ORA-1458: Invalid length inside variable character string
We have created a web application that read and write on an Oracle database with a ODBC connection.
I think that there isn't a code error because I get this error everytime in different phases of the application and because after some time I can be able to execute the operation that have caused the error.
Do you have any idea?
Thanks, Nunzio
Hi
I dont' remenber having this error before.
Mayba the ODBC is the bottleneck. It is possible that the ODBC driver couldn't manage so long string that your data is. Maybe you should transfrom the clob into varchar2 or long varchar.
Ott Karesz
http://www.trendo-kft.hu
Similar Messages
-
ORA-01458: invalid length inside variable character string
We encountered a serious problem in production system where we were getting this ORA error.
The common search on google results into the following explaination.
Cause: An attempt was made to bind or define a variable character string with a buffer length less than the minimum requirement.
Action: Increase the buffer size or use a different type.
However on analysis we found that the error was because, the value that was being bound to bind variable was NULL.
This was a new finding for me.
Please share your experiences/views on this.without any code and data examples this is impossible
-
ORA-1459 INVALID LENGTH FOR VARIABLE CHARACTER STR
HI Guys,
Developers in my team are facing this problem.
I thought this error is not related to database. IS it?\
Can you please provide me with any details on this error.
Thanks
VijayYou can find all errors online at http://tahiti.oracle.com
So far, you have exclusively been asking questions for which you can and refuse to look up the answer in the online documentation.
I hereby ask you formally to stop asking doc questions, and to consult documentation before posting anything.
Sybrand Bakker
Senior Oracle DBA -
Error -ORA-01483: invalid length for DATE or NUMBER bind variable
In discoverer plus, attempt to save a discoverer workbook into the database fails with the error:
ORA-01483 invalid length for DATE or NUMBER bind variable
The same workbook can be safely saved in "My Computer".
Any idea why and what is the solution.Why: not quite sure, probably the code is validating the workbook when it saves it to the db and you've got an error in the sql. What happens when you run the workbook that you saved to the file system? Does it show the same error when run?
Solution: Can you post the sql in the workbook? In the meantime try the following: Replace any to_char statements around dates with to_date statements instead. For example:
Replace:
where to_char(mydate, 'dd-mon-yyyy') = '05-apr-2009'
With:
where mydate = to_date('05-APR-2009','DD-MON-YYYY') -
ORA-06502 nuemeric or value error: character string buffer too small
i am getting above error while doing
ORA-06502 nuemeric or value error: character string buffer too small
ORA-06512 itw_item_add_ch at line 17
plz urgent
CREATE OR REPLACE procedure itw_item_add_ch (header_id1 number, folio out varchar2,tariff out varchar2) as
cursor item_add(header_id1 number) is
SELECT
DISTINCT c.attribute4 item_tariff_no,
c.attribute5 item_folio
FROM OE_ORDER_LINES_ALL b,
mtl_system_items c
WHERE b.flow_status_code not in ('SHIPPED','FULFILLMENT','CLOSED')
and b.inventory_item_id = c.inventory_item_id
and b.ship_from_org_id = c.organization_id
and b.header_id = header_id1;
begin
for item_att in item_add(header_id1) loop
if folio is null then
folio := item_att.item_folio;
else
folio := folio||'/'||item_att.item_folio;
end if;
if tariff is null then
tariff := item_att.item_tariff_no;
else
tariff := tariff||'/'||item_att.item_tariff_no;
end if;
end loop;
end;if you want to find out which of your two variables are causing the problem, then use pragma exception_init along with "begin end exception" blocks within the loop.
I've removed the procedure specification, so you can test this in SQL Plus. You need to supply a number to the Header_id1 variable something like this:
set serveroutput on
begin
header_id1 number := 1; -- supply your own parameter here
cursor Item_Add(Header_Id1 number) is
select
distinct c.Attribute4 Item_Tariff_No
,c.Attribute5 Item_Folio
from Oe_Order_Lines_All b
,MTL_System_Items c
where b.Flow_Status_Code not in ('SHIPPED','FULFILLMENT','CLOSED')
and b.Inventory_Item_Id = c.Inventory_Item_Id
and b.Ship_From_Org_Id = c.Organization_Id
and b.Header_Id = Header_Id1;
exception TOO_MANY_CHARS;
exception TOO_TARIFF_CHARS;
pragma exception_init(TOO_MANY_CHARS, -6502);
l_Folio varchar2(32747);
l_Tariff varchar2(32747);
l_Folio_Continue boolean := true;
l_Tariff_Continue boolean := true;
begin
for Item_Att in Item_Add(Header_Id1) loop
if (l_Folio_Continue) then
begin
if l_Folio is null then
l_Folio := Item_Att.Item_Folio;
else
l_Folio := l_Folio||'/'||Item_Att.Item_Folio;
end if;
exception
when TOO_MANY_CHARS then
dbms_output.put_line ('Foilio has too many values ');
l_Folio_Continue := false;
exit;
end;
end if;
if (l_Tariff_Continue) then
begin
if l_Tariff is null then
l_Tariff := Item_Att.Item_Tariff_No;
else
l_Tariff := l_Tariff||'/'||Item_Att.Item_Tariff_No;
end if;
exception
when TOO_MANY_CHARS then
dbms_output.put_line ('Tariff has too many values ');
l_Tariff_Continue := false;
exit;
end if;
end loop;
end;
/this is untested, so please sort out any compilation errors yourself. -
Report failed to parse SQL query:ORA-01745: invalid host/bind variable name
Hi,
We are currently upgrading from v2.2.0.00.32 to v4.0.0.00.46.
I have copied the applications onto our test server along with the various database objects and data etc.
When I am running a report in v4, it is failing with the following error: "failed to parse SQL query: ORA-01745: invalid host/bind variable name".
When I copy the SQL that builds the report into TOAD (on out test server) it runs OK so really cant see why it would fail in APEX. It works fine when I run the query in our APEX v2 and in TOAD in our live server.
The query is as follows:
SELECT
aea.ALTERATION_ID
,aea.ALTERATION_ID "ALTERATION_ID_DISPLAY"
,aea.assembly_name "Revised BOM"
,assembly.description "Revised BOM Description"
,assembly.INVENTORY_ITEM_STATUS_CODE "Revised BOM Status"
,aea.BEFORE_CHANGE_QTY
,flv.MEANING "Alteration Type"
,aea.component_name "Part No"
,component.description "Part No Description"
,component.INVENTORY_ITEM_STATUS_CODE "Part No Status"
,aea.AFTER_CHANGE_QTY
,TO_CHAR(aea.last_update_date,'DD-MM-YYYY HH24:MI:SS')"Last Update Date"
,aea.LAST_UPDATE_BY
,aea.COMMENTS
,aea.ORACLE_CHANGE_NOTICE
,AEA.SELECTION_CRITERIA
FROM XXMEL_APEX_ECO_ALTERATIONS aea
, fnd_lookup_values flv
, (SELECT INVENTORY_ITEM_STATUS_CODE
,segment1
,description
FROM mtl_system_items_b
WHERE 1=1
AND organization_id = 26) component
, (SELECT INVENTORY_ITEM_STATUS_CODE
,segment1
,description
FROM mtl_system_items_b
WHERE 1=1
AND organization_id = 26) assembly
WHERE 1=1
AND aea.COMPONENT_NAME = component.segment1 (+)
AND aea.assembly_NAME = assembly.segment1 (+)
AND flv.lookup_code = aea.acd_type
AND aea.eco = :P13_ECO
AND flv.lookup_type = 'ECG_ACTION'
AND modify_flag = 'Y'
ANy help would be great,
Thanks
Chris
Edited by: Cashy on 22-Nov-2010 04:13
Edited by: Cashy on 22-Nov-2010 04:14For some reason, the updatable fields (this is a updateable report) where not connecting to the database properly. Whn I changed them to a report columns and removed the database field reference, the report rendered
-
Dashboard refresh - ORA-24373 invalid length specified for statement
Post Author: Reesy
CA Forum: Performance Management and Dashboards
I am getting the following error message in the log file "ORA-24373: invalid length specified for statement" when trying to refresh a metric via dashboard manager. The metric has been successfully refreshed previously. The only change that I am aware of is that more data has been added to the underlying database (Oracle 10g).
There are a number of different filters on the metric - some work ok - some give the above error.
Can anyone help?
CheersIWOULDFORMATMYCODESOITISREADABLEUSINGMIXEDCASESPACESANDNEWLINES.
ATABLEALIASWOULDPROBABLYHELPTOO. -
OLAP -- ORA-6502: numeric or value error: character string buffer too small
Hi all,
We got installed Oracle 9201. After applying the patch #2761332 (to upgrade up to 9203)
and interim patch #2897078 (9203 Patch 1) we always get OLAP Catalog invalid.
I've tried to mend this problem by doing all it is said in Notes 23268.1 & 226443.1 but
my effort was worthless. OLAP catalog is still invalid though BI_Checkconfig says is okay at all.
Nevertheless, we can create dimensions, cubes and measures well, but other problem arises when
I try to add a dimension to a cube issuing the following command:
cwm2_olap_cube.add_dimension_to_cube( owner, NAME, owner, DIM_NAME);
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "OLAPSYS.CWM2_OLAP_MANAGER", line 380
ORA-06512: at "OLAPSYS.CWM2_OLAP_MANAGER", line 397
ORA-06512: at "OLAPSYS.CWM2_OLAP_CUBE", line 281
Paying attention to other metalink/otn threads about this subject we found similar problems with
Oracle 9203 in Japanese (keeping in mind we use Oracle in Spanish).
Any patch we can apply? Any ideas? Your comments are welcome ...
Thanks in advanced !!
[email protected]We have fixed the problem !!! :-DDD
Thanks to all Oracle analysts who replied this issue.
aLeX
[email protected] -
ORA-06502: numeric or value error: character string buffer too small
I have a stored proc with a parameter pio_med_rec_nbr patient.med_rec_nbr%TYPE
where patient.med_rec_nbr is a varchar2(12) .
character set is we8mswin1252 semantics are bytes
the stored proc retrieves max(med_rec_nbr) into nTmp( number) from a reference table
and does pio_med_rec_nbr := lpad(TO_CHAR(nTmp),12,'0')
which throws the ORA-06502: PL/SQL: numeric or value error: character string buffer too smallwhen I check the length, I get length(pio_med_rec_nbr) = 12
I can pass one digit or null but no more. Any idea what I need to do to debug this? I can do xxtmp := lpad(TO_CHAR(nTmp),12,'0') where xxtmp varchar2(255), so I know the assignments are okay.
Thanks,Do, pio_med_rec_nbr := trim(lpad(TO_CHAR(nTmp),12,'0') )
-
ORA 01745 (invalid host/bind variable name) and CURSOR_SHARING
For the past couple of weeks, a user has had an issue with an application in the production environment only. I've had the vendor looking at it but they were limited since it could not be reproduced in our DEV environment. I finally had some time to look into it myself and I found the problem SQL statement. The issue boils down to this, "SELECT 'N' INDICATOR FROM DUAL;" returns an ORA-01745 error. If I rename "INDICATOR" to "INDICATO" or if I add an "AS" before the alias, the query works fine. However, it would require the vendor to change the code in the application which is not likely (not for free at least). However, I also found if I change the CURSOR_SHARING from SIMILAR to EXACT, then it works. This was the reason for the difference between DEV & PRD. PRD is set to SIMILAR while DEV is set to EXACT. The prospect of setting PRD to EXACT to appealing as I'm afraid it may affect performance in other areas. But, in the end, that may be the only solution. However, I was hoping there might be some other parameter that I am not aware of that may also fix this issue. I am running 10.2.0.4. Any help would be appreciated.
I'm not sure.
To what extent can you reproduce the problem? Can you isolate it to the db only via sql*plus? Or does this other software need to be involved?
You may to do some end-to-end tracing including client/driver side.
If you raise with Oracle Support, you may find out more.
I take it that the software doesn't really issue this statement:
SELECT 'N' INDICATOR FROM DUAL;" and it's part of a bigger statement? -
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. -
i'm getting this error when i try to do the following
6502 = ORA-06502: PL/SQL: numeric or value error: character string buffer too small
declare
str1Query varchar2(32767);
str2Query varchar2(32767);
str3Query varchar2(32767);
str31Query varchar2(32767);
str32Query varchar2(32767);
str4Query varchar2(32767);
desc_t dbms_sql.desc_tab2;
l_col_cnt integer;
colvalue varchar(32676);
cur_rows number;
repCursor integer;
begin
repCursor := dbms_sql.open_cursor;
dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
DBMS_SQL.CLOSE_CURSOR (repCursor);
end;
if there is any ideas about what is wrongThat is not the PL/SQL block that you have run to get that error, right?
What are the sizes of the individual variables - str1Query, str2Query etc...
Whay are there so many variables joined together?
That posted code cannot generate the error you posted:
SQL> declare
2
3 str1Query varchar2(32767);
4 str2Query varchar2(32767);
5 str3Query varchar2(32767);
6 str31Query varchar2(32767);
7 str32Query varchar2(32767);
8 str4Query varchar2(32767);
9 desc_t dbms_sql.desc_tab2;
10 l_col_cnt integer;
11 colvalue varchar(32676);
12 cur_rows number;
13 repCursor integer;
14
15 begin
16
17 repCursor := dbms_sql.open_cursor;
18 dbms_sql.parse(repCursor,str1Query || ' ' || str2Query || ' ' || str3Query || ' ' || str31Query || ' ' || str32Query || str4Query,dbms_sql.native);
19 dbms_sql.describe_columns2( repCursor, l_col_cnt, desc_t );
20 DBMS_SQL.CLOSE_CURSOR (repCursor);
21 end;
22 /
declare
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at "SYS.DBMS_SYS_SQL", line 826
ORA-06512: at "SYS.DBMS_SQL", line 39
ORA-06512: at line 18
SQL> -
WWV_FLOW_WORKSHEET_CONDITIONS - ORA-06502 character string buffer too small
Hi,
I am currently working on a application that can upload CSV files inside many tables. Since I hate reinventing the wheels, I have decided to reverse engineer APEX and APEX APIs that are used by the SQL Workshop to upload CSV files to a single table. Since this feature was tested many times by many developers around the world, I know I can trust the code. If in a future release of APEX those packages are modified, I'll have to update my abstraction layer to call my own packages instead of APEX packages. (This is not an issue for our team.)
First Step
Use apex_040000.wwv_flow_load_data.create_csv_collection to create an apex collection with the first 20 rows of the csv file. At this step, we can validate the format of a sample of the file without loading all rows of the csv file.
Second Step
Use apex_040000.wwv_flow_load_data.load_csv_data to upload all rows of the csv file inside a table.
Third Step
Do whatever you want with the data inside the table. (i.e.: Send the data into multiple tables...)
Here's my problem..._
After the first or second steps, I display the data using interactive reports. I want to highlight every cells containing "invalid" data. I use apex_040000.wwv_flow_worksheet_api.add_or_update_highlight. When I have too many invalid cells, the IR doesn't show at run time, and you can see ORA-06502: PL/SQL: numeric or value error: character string buffer too small on the page.
I would like to know the limitations of IR using the table WWV_FLOW_WORKSHEET_CONDITIONS. Is there a way to create many highlight conditions inside a single row of WWV_FLOW_WORKSHEET_CONDITIONS ? I want to find the best approach to add hundreds of conditions.
Thanks
Louis-Guillaume Carrier-Bédard
My Google+: https://profiles.google.com/lgcarrier
My Blog: http://www.lgcarrier.com
Twitter: http://www.twitter.com/lgcarrier
APEX Québec: http://www.apexquebec.com
APEXFramework: http://www.apexframework.comAt run time, when I look at the html source code, I can see all the generated CSS rules to highlight the cells of the IR.
ie.: *.apexir_WORKSHEET_DATA tr td.rule_5352115461902443_td {background-color:#FF0000 !important;}* -
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. -
We face the above error in HTMLDB (APEX) application Ver 3.1.0. This occurs when we try to display more number of rows/records in drop-down list (LOV in tabular forms). We are able to display 200 records in LOV. When the list of records exceeds 230, we face the below error
report error:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
the values listed in LOV are from tables (one of the columns in table)
Could anyone give us a solution?Hi
As you are using a tabular form, you could actually do the following:
1 - In the tabular form column's attributes, set the following:
Display as: Select List (query based on LOV)
Display extra values: Yes
List of values definition: SELECT null d, null r FROM DUAL
2 - Add a new page item and set it to generate your select list
3 - Create an HTML region with no template and use the following for its source:
<script type="text/javascript">
function loadList(c, l)
var s = document.getElementsByName(c);
var lItem = document.getElementById(l);
var lLength = lItem.options.length;
var k;
var j;
var x = lItem.innerHTML;
var v;
var o;
var z;
for (k = 0; k < s.length; k++)
z = s[k];
v = z.value;
z.options.length = 0;
for (j = 0; j < lLength; j++)
o = new Option()
o.value = lItem[j].value;
o.text = lItem[j].text;
z.options[j] = o;
z.value = v;
if (z.selectedIndex == -1)
z.selectedIndex = 0;
loadList("f05", "P1_MGR");
</script>
(Change "f05" and "P1_MGR" as appropriate to your column and your new page item respectively)
Now, when you load the page, the select list contains a null entry plus the entry already on the database. The javascript kicks in automatically, loops through every entry in the "f05" column, copies the existing value, replaces the select list with the new page item version and sets its value to the copied value.
Your new page item could be in a DIV tag that has a style of "display:none" to hide it from view.
Andy
Maybe you are looking for
-
Is there a way to delete multiple pictures at the same time from the iphone4s?
Is there a way to deleter multiple pictures at the same time, from my iphone4s? I know how to delete one at a time. Thanks
-
Hi All, We are working on Oracle Database 10g We have to develop a code which involves Configure To Order (CTO) and Engineer To Order (ETO) items. Can anyone advise is there any table and the corresponding column in the database which will help ident
-
A plug-in for Adobe Color in the app or to allow the download file to be accessed by Muse
I think it would be awesome to have the functionality of adobe color CC. so that we can search for colors in the app or allow us to download the file drop it into the app for use, so we won't have to screenshot the color and color pick them.
-
SCOM 2012 RC - SCVMM 2012 RC - Virtual machine manager management group is not getting monitored
Hi All, I have integrated SCOM 2012 with SCVMM 2012 environment. I could see two strange behaviors. All these instance are running on Windows 2008 R2 + Sp1 OS along with SQL 2008 R2 for database. 1) I could see two instance of VirtualmanagerDB in t
-
Unable to add ringtone at any cost
I have been trying to add a ringtone to my iphone using itunes but there are small issues i am facing. 1) The mp3 song i have draggged to the music folder in itunes does not appear in the itunes library. 2) when i try to create the AAC version i get