Round Value error
hi,
I have to calculate Salary into textfield .
Problem is after Calculation salary amount 1230.3566678787 like this come into text field.
i want only 1230.35 amount.
How can i do this.
Thanks
hi,
i am using java scrip to calculation after calculation value comes into text field.
like 1230.7537647
i want this in to text fild like 1230.75
my java scipt
<script>
function multiplyItems(){
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
$x('P65_SALARY').value =getVal('P65_ADVANCE_PAYMENT')+
getVal('P65_OVR_TM_AMT')+getVal('P65_BONUS') + getVal('P65_OTHER_CHARGES')-getVal('P65_LEAVE_AMOUNT');
</script>How can i do that.
Thanks
Similar Messages
-
Hi Team,
I am running one conc programme.
After running I am getting below error. I checked the issue on metalink and other, seems that it is an size related issue. I have increased the size of formula columns and placeholdder too.
But still getting issue.
My requirement is to get comma seperated values using SQL query itself. Neither i wanted to create layout of the report , since it is a XML publisher report and nor I am including it on RTF template.
I want the CF_10 formula column to be populated with comma seperated values.
MSG-00187: From Date 01-Sep-2014
REP-1401: 'cf_10formula': Fatal PL/SQL error occurred.
ORA-06502: PL/SQL: numeric or value error
And Here is my code for CF_10
function CF_10Formula return Number is
begin
SELECT NVL(TO_CHAR(sum(Amount),'99,99,99,999'),0) into :CP_5 --NVL(ROUND(sum(Amount)),0) into :CP_5
-- xxhw_Coll_cat(category) "Intercat Catg"
FROM hhxw_Region_col_v
WHERE Category IN ('Intercompany - CATV')
AND trunc(gl_date) BETWEEN TO_DATE(:P_FROM_DATE, 'DD/MM/RRRR') AND TO_DATE(:P_TO_DATE, 'DD/MM/RRRR');
RETURN ROUND(:CP_5);
end;
Anyone please suggest me.
Regards,
SachinHi,
1)Why are you selecting the value into a report item? Select into a local variable and return that
RETURN :CP_5 --> This one!!
2)And you should avoid applying functions to DB columns in where clauses wherever possible, so oracle can use indexes on them if applicable:
AND gl_date >= To_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < To_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
I think you are taking 2 column in the Layout CF_10 and CP_5 right? if so, then use below Query.
FUNCTION cf_10formula
RETURN NUMBER
IS
v_amount NUMBER:null;
IS
BEGIN
BEGIN
SELECT nvl(round(SUM(amount)), 0)
INTO v_amount --> Retruns the value for CF_10 column
FROM hhxw_region_col_v
WHERE category IN ( 'Intercompany - CATV' )
AND gl_date >= to_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < to_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
:CP_5 := nvl(trunc(v_amount),0); --> Retruns the value for CP_5 column
EXCEPTION
WHEN OTHERS THEN
v_amount := 0;
srw.message(1003,'Error in Getting :' ||p_from_date);
END;
END;
And
If you've got a number function returning into a number field then all you should need to do to make the comma appear is to change the number format mask in field.
From 40000 to 40,000 -
Hi,
I'm playing a little bit with the trial version of Numbers, just to see if my good old Ti is still capable to run it properly before buying a full license of iWorks.
By the way, it seems like there's some kind of round-off error. Try to build a series as follows: enter -10 in to a cell, then let Numbers build the series using the usual formula "previous cell value - 0.1". Apply a format so that only two decimal values are visible. Drag the formula and build twenty values (just to have some values). Now use the previous series and calculate its squared values. Then select some cells in the squared values column, starting from the first one: as soon as you include the squared value of -9.3 in the selection you will see that the data inspector will show a min value equal to 86.4900000000001 , which should be the squared value of +/- 9.3.
Now, try to subtract 86.49 to that cell and you will see that the result is not exactly zero: you can try to calculate the inverse of it and, instead of an error, you get a very big (actually, not that big!) number.
You can easily reproduce this weird behavior if you open Calculator and calculate the squared value of 9.3: until you set the precision up to 14, you get the correct value, you select precision >= 15, you get the round off value.
So, it seems it is not a Numbers only related problem.
Just for the record, I've just calculated the same value into Octave, and the result is correct (and different):
86.4900000000000 (Octave)
86.4900000000001 (Numbers)
Yet not so serious, this kind of "numerical noise" might lead to annoying issues...HI SIR,
WE CREATED ONE PO .IN THAT PO ITEM NO2 SHOWING NET VALUE AS 11.63 FOR MATERIAL CS PLATE WHER AS ITEM NO 5 SHOWING NET VALUE AS 11.62 FOR SAME MATERIAL AND SAME PRICING CONDITIONS.
Hi ,
Please check in item conditions whether have you entered discount conditions in line itenm 5.
Regards,
Vijay -
Numeric or value error Line 410??? appending to lob
line 410 is marked with line of '%%%%%%%%%%%%%%%%%%%%%'
This script is designed to profile data in a set of table by generating sql and running it with an execute immediate. It works by generating a set of code for each datatype and then executing the code twice for each table. Once for the summary profile and once for the detail profile. I've been starting at it awhile and can't figure out what the error means??? Thanks in advance!
set serveroutput on size 1000000
set feedback off
SET ECHO OFF
declare
c clob;
t varchar2(2000);
e varchar2(2000);
cursor c1 is select distinct owner,table_name from all_tab_columns
where table_name in ('PS_F_AP_AGING'
,'PS_F_AP_TRAN'
,'PS_F_VCHR_MTCH_EXP'
,'PS_F_APAR_NETTING'
,'PS_F_AR_AGING'
,'PS_F_AR_ACCOUNT_LN'
,'PS_F_AR_DSO'
,'PS_F_AR_TRAN'
,'PS_F_ASGN'
,'PS_F_CA_AMD'
,'PS_F_CA_DTL_DIST'
,'PS_F_CA_DTL_TRANS'
,'PS_F_CA_REV_RECOGN'
,'PS_F_EXP_DTL_DIST'
,'PS_F_GM_AWARD'
,'PS_F_GM_PRJ_TRAN'
,'PS_F_GM_PRP_AWD'
,'PS_F_PRJ_AC_CUR'
,'PS_F_PRJ_AC_PRDC'
,'PS_F_PRJ_CHNG'
,'PS_F_PRJ_CUR'
,'PS_F_PRJ_PRDC'
,'PS_F_PRJ_TRAN'
,'PS_F_PRP_VER_TRANS'
,'PS_F_RSRC_RT'
,'PS_F_INV_CYCLE_CNT'
,'PS_F_INV_LDGR'
,'PS_F_INV_TRANS'
,'PS_F_PHYSICAL_INV'
,'PS_F_BEGIN_BAL'
,'PS_F_JOURNAL'
,'PS_F_KK_ACTIVITY'
,'PS_F_KK_BALANCES'
,'PS_F_KK_BUD_ASSOC'
,'PS_F_KK_ENCUMBRAN'
,'PS_F_KK_EXCEPTION'
,'PS_F_KK_JOURNAL'
,'PS_F_KK_LEDGER'
,'PS_F_KK_OVERRIDES'
,'PS_F_KK_TRANS_LOG'
,'PS_F_LEDGER'
,'PS_F_MTCH_ANLYS'
,'PS_F_PO_DIST'
,'PS_F_PO_LINE'
,'PS_F_PO_SHIP_RCPT'
,'PS_F_PROC_CTLT'
,'PS_F_REQN'
,'PS_F_REQN_ANLYSIS'
,'PS_F_RTV'
,'PS_F_RTV_DIST'
,'PS_F_SCP_CAPACITY'
,'PS_F_SCP_INVENTORY'
,'PS_F_SCP_PRODN'
,'PS_F_SCP_PURCHASNG'
,'PS_F_SCP_SLS_FCST'
,'PS_F_SCP_TRANSFERS'
,'PS_F_SCPSLS_ACTUAL'
,'PS_F_VCHR'
,'PS_F_VCHR_DIST_LN'
,'PS_F_VCHR_LN'
/*,'PS_D_ACCOUNT'
,'PS_D_ACTGRY_AR_VW'
,'PS_D_AGING_CTGRY'
,'PS_D_ALTACCT'
,'PS_D_ANLYS_TYPE'
,'PS_D_AP_DOC_TYPE'
,'PS_D_AP_PTR_STAT'
,'PS_D_AP_PTR_TYPE'
,'PS_D_AP_PYMNT_TRMS'
,'PS_D_AP_VTR_STAT'
,'PS_D_AP_VTR_TYPE'
,'PS_D_APPOST_STATUS'
,'PS_D_AR_DOC_TYPE'
,'PS_D_AR_ITR_STAT'
,'PS_D_AR_ITR_TYPE'
,'PS_D_AR_PTR_STAT'
,'PS_D_AR_PTR_TYPE'
,'PS_D_ASGN'
,'PS_D_ASGN_STAT'
,'PS_D_BANK_ACCT'
,'PS_D_BOOK_CODE'
,'PS_D_BU_LED_GRP'
,'PS_D_BUCKET'
,'PS_D_BUDGET_REF'
,'PS_D_BUSINESS_UNIT'
,'PS_D_BUYER'
,'PS_D_CA'
,'PS_D_CA_AMD_RSN'
,'PS_D_CA_AMD_TYPE'
,'PS_D_CA_DTL'
,'PS_D_CA_JNK'
,'PS_D_CARRIER'
,'PS_D_CHANNEL'
,'PS_D_CHARTFIELD1'
,'PS_D_CHARTFIELD2'
,'PS_D_CHARTFIELD3'
,'PS_D_CLASS_FIELD'
,'PS_D_CNCL_STATUS'
,'PS_D_COLLECT_STAT'
,'PS_D_COMP_STATUS'
,'PS_D_CUST_ORG'
,'PS_D_CUSTOMER'
,'PS_D_DAY'
,'PS_D_DEDUCT_STAT'
,'PS_D_DEPT'
,'PS_D_DET_BUDGET'
,'PS_D_DET_PERIOD'
,'PS_D_DISPUTE_STAT'
,'PS_D_DIST_ACCT'
,'PS_D_DLVRY_STATUS'
,'PS_D_DT_PATTERN'
,'PS_D_ENTRY_RSTYP'
,'PS_D_EX_LOCATION'
,'PS_D_EXP_LN'
,'PS_D_EXP_RPT'
,'PS_D_FUND'
,'PS_D_GL_ADJ_TYPE'
,'PS_D_GM_AWARD'
,'PS_D_GM_INST'
,'PS_D_GM_PI'
,'PS_D_GM_PROP_PROJ'
,'PS_D_GM_PRP'
,'PS_D_GM_SPONSOR'
,'PS_D_INV_ITEM'
,'PS_D_INV_LOCATION'
,'PS_D_INVST_REASON'
,'PS_D_JOBCODE'
,'PS_D_JRNL_SOURCE'
,'PS_D_KK_BUDG_JNK'
,'PS_D_KK_BUDG_TYPE'
,'PS_D_KK_SOURCE_TRAN'
,'PS_D_LEDGER'
,'PS_D_LOT'
,'PS_D_MATCH_RULE'
,'PS_D_MRCHNT'
,'PS_D_MTCH_STATUS'
,'PS_D_OPER_UNIT'
,'PS_D_ORD_CAPTURE'
,'PS_D_ORIGIN'
,'PS_D_PATTERN_DAY'
,'PS_D_PERSON'
,'PS_D_PERSON_APOPID'
,'PS_D_PERSON_ARSPL'
,'PS_D_PERSON_COLTR'
,'PS_D_PERSON_CRNYST'
,'PS_D_PO_STATUS'
,'PS_D_PRJ'
,'PS_D_PRJ_AC'
,'PS_D_PRJ_AC_STAT'
,'PS_D_PRJ_CHNG'
,'PS_D_PRJ_HLTH'
,'PS_D_PRJ_ROLE'
,'PS_D_PRJ_RSRC'
,'PS_D_PRJ_RSRC_TYPE'
,'PS_D_PRJ_STAT'
,'PS_D_PRJ_TRAN_STAT'
,'PS_D_PRODUCT'
,'PS_D_PROGRAM_FDM'
,'PS_D_PRP'
,'PS_D_PRP_DTL'
,'PS_D_PY_TRMS_AR_VW'
,'PS_D_PYMNT_MTHD'
,'PS_D_RECLN_STATUS'
,'PS_D_RECV_STATUS'
,'PS_D_REQ_STATUS'
,'PS_D_REQLN_STATUS'
,'PS_D_RTRN_REASON'
,'PS_D_RTV_STATUS'
,'PS_D_RTVLN_STATUS'
,'PS_D_SALES_ORG'
,'PS_D_SCENARIO'
,'PS_D_SHIPTO'
,'PS_D_SO'
,'PS_D_SOURCE_TBL'
,'PS_D_STAT_CODE'
,'PS_D_SUPPLIER'
,'PS_D_TASK_TYPE'
,'PS_D_TIME'
,'PS_D_UOM'
,'PS_D_USER'
,'PS_D_WORK_CENTER'
,'PS_DEMAND_INF_INV'
,'PS_DEMAND_INV'
,'PS_DEPL_PLAN'
,'PS_DEPOSIT_CONTROL'
,'PS_DISTRIB_LIN'*/);
begin
for i in c1 loop
dbms_lob.createtemporary(c, true);
t := 'INSERT INTO DATA_PROFILE_COL_SUM ';
dbms_lob.writeappend(c,length(t), t);
--DBMS_OUTPUT.PUT_LINE(T);
----date
FOR MYSQLTEXT IN (SELECT
'select '
|| '''' || C.table_name || '''' || ' as tname, '
|| '''' || C.column_name || '''' || ' as cname, '
|| '''' || C.data_type || '''' || ' as data_type, '
|| '''' || nvl(c.data_length, 0) || '''' || ' as data_length, '
|| '''' || nvl(c.data_precision, 0) || '''' || ' as data_precision, '
|| '''' || nvl(c.data_scale, 0) || '''' || ' as data_scale, '
|| '''' || c.nullable || '''' || ' as nullable, '
|| '''' || nvl(c.num_distinct,0) || '''' || ' as num_distinct, '
|| '''' || nvl(c.density,0.0) || '''' || ' as density, '
|| '''' || nvl(c.num_nulls,0) || '''' || ' as num_nulls, '
|| '''' || nvl(c.char_col_decl_length,0) || '''' || ' as col_length, '
|| '''' || nvl(c.avg_col_len,0) || '''' || ' as avg_col_length, '
|| '''' || nvl(c.char_length,0) || '''' || ' as char_length, '
|| '''' || nvl(tblc.comments, 'NONE') || '''' || ' as table_comments, '
|| '''' || nvl(colc.comments, 'NONE') || '''' || ' as column_comments, '
|| ' count(*) as rcount, min('
|| c.column_name || ') as min_date, max('
|| c.column_name || ') as max_date, '
|| ' null as min_integer, null as max_integer, '
|| ' null as min_number, null as max_number, '
|| ' null as min_varchar2, null as max_varchar2, min(length('
|| c.column_name || ')) as min_len, max(length('
|| c.column_name || ')) as max_len, sysdate'
|| ' from '
|| C.owner || '.' || C.table_name
|| ' ' || CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
left outer join sys.all_tab_comments tblc
on t.owner = tblc.owner
and t.table_name = tblc.table_name
left outer join sys.all_col_comments colc
on c.owner = colc.owner
and c.table_name = colc.table_name
and c.column_name = colc.column_name
where c.owner = I.OWNER
and c.data_type = 'DATE'
and c.table_name = I.TABLE_NAME
LOOP
-- DBMS_OUTPUT.PUT_LINE(MYSQLTEXT.MYSQL);
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
----number
FOR MYSQLTEXT IN (select
'select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| '''' || c.data_type || '''' || ' as data_type, '
|| '''' || nvl(c.data_length, 0) || '''' || ' as data_length, '
|| '''' || nvl(c.data_precision, 0) || '''' || ' as data_precision, '
|| '''' || nvl(c.data_scale, 0) || '''' || ' as data_scale, '
|| '''' || c.nullable || '''' || ' as nullable, '
|| '''' || nvl(c.num_distinct,0) || '''' || ' as num_distinct, '
|| '''' || nvl(c.density,0.0) || '''' || ' as density, '
|| '''' || nvl(c.num_nulls,0) || '''' || ' as num_nulls, '
|| '''' || nvl(c.char_col_decl_length,0) || '''' || ' as col_length, '
|| '''' || nvl(c.avg_col_len,0) || '''' || ' as avg_col_length, '
|| '''' || nvl(c.char_length,0) || '''' || ' as char_length, '
|| '''' || nvl(tblc.comments, 'NONE') || '''' || ' as table_comments, '
|| '''' || nvl(colc.comments, 'NONE') || '''' || ' as column_comments, '
|| ' count(*) as rcount, null as min_date, null as max_date, '
|| ' null as min_integer, null as max_integer, min('
|| c.column_name || ') as min_number, max('
|| c.column_name || ') as max_number, null as min_varchar2, null as max_varchar2, min(length('
|| c.column_name || ')) as min_len, max(length('
|| c.column_name || ')) as max_len, sysdate '
|| ' from '
|| t.owner || '.' || c.table_name
|| ' ' || CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
left outer join sys.all_tab_comments tblc
on t.owner = tblc.owner
and t.table_name = tblc.table_name
left outer join sys.all_col_comments colc
on c.owner = colc.owner
and c.table_name = colc.table_name
and c.column_name = colc.column_name
where c.owner = I.OWNER
and c.data_type = 'NUMBER'
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
--integer
FOR MYSQLTEXT IN (select
'select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| '''' || c.data_type || '''' || ' as data_type, '
|| '''' || nvl(c.data_length, 0) || '''' || ' as data_length, '
|| '''' || nvl(c.data_precision, 0) || '''' || ' as data_precision, '
|| '''' || nvl(c.data_scale, 0) || '''' || ' as data_scale, '
|| '''' || c.nullable || '''' || ' as nullable, '
|| '''' || nvl(c.num_distinct,0) || '''' || ' as num_distinct, '
|| '''' || nvl(c.density,0.0) || '''' || ' as density, '
|| '''' || nvl(c.num_nulls,0) || '''' || ' as num_nulls, '
|| '''' || nvl(c.char_col_decl_length,0) || '''' || ' as col_length, '
|| '''' || nvl(c.avg_col_len,0) || '''' || ' as avg_col_length, '
|| '''' || nvl(c.char_length,0) || '''' || ' as char_length, '
|| '''' || nvl(tblc.comments, 'NONE') || '''' || ' as table_comments, '
|| '''' || nvl(colc.comments, 'NONE') || '''' || ' as column_comments, '
|| ' count(*) as rcount, null as min_date, null as max_date, '
|| ' null as min_integer, null as max_integer, min('
|| c.column_name || ') as min_number, max('
|| c.column_name || ') as max_number, null as min_varchar2, null as max_varchar2, min(length('
|| c.column_name || ')) as min_len, max(length('
|| c.column_name || ')) as max_len, sysdate '
|| ' from '
|| t.owner || '.' || c.table_name
|| ' ' || CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
left outer join sys.all_tab_comments tblc
on t.owner = tblc.owner
and t.table_name = tblc.table_name
left outer join sys.all_col_comments colc
on c.owner = colc.owner
and c.table_name = colc.table_name
and c.column_name = colc.column_name
where c.owner = I.OWNER
and c.data_type = 'INTEGER'
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
--char and varchar
FOR MYSQLTEXT IN (select
'select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| '''' || c.data_type || '''' || ' as data_type, '
|| '''' || nvl(c.data_length, 0) || '''' || ' as data_length, '
|| '''' || nvl(c.data_precision, 0) || '''' || ' as data_precision, '
|| '''' || nvl(c.data_scale, 0) || '''' || ' as data_scale, '
|| '''' || c.nullable || '''' || ' as nullable, '
|| '''' || nvl(c.num_distinct,0) || '''' || ' as num_distinct, '
|| '''' || nvl(c.density,0.0) || '''' || ' as density, '
|| '''' || nvl(c.num_nulls,0) || '''' || ' as num_nulls, '
|| '''' || nvl(c.char_col_decl_length,0) || '''' || ' as col_length, '
|| '''' || nvl(c.avg_col_len,0) || '''' || ' as avg_col_length, '
|| '''' || nvl(c.char_length,0) || '''' || ' as char_length, '
|| '''' || nvl(tblc.comments, 'NONE') || '''' || ' as table_comments, '
|| '''' || nvl(colc.comments, 'NONE') || '''' || ' as column_comments, '
|| ' count(*) as rcount, null as min_date, null as max_date, '
|| ' null as min_integer, null as max_integer, '
|| ' null as min_number, null as max_number, min('
|| c.column_name || ') as min_varchar2, max('
|| c.column_name || ') as max_varchar2, min(length('
|| c.column_name || ')) as min_len, max(length('
|| c.column_name || ')) as max_len, sysdate'
|| ' from '
|| t.owner || '.' || c.table_name
|| ' ' || CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
left outer join sys.all_tab_comments tblc
on t.owner = tblc.owner
and t.table_name = tblc.table_name
left outer join sys.all_col_comments colc
on c.owner = colc.owner
and c.table_name = colc.table_name
and c.column_name = colc.column_name
where c.owner = I.OWNER
and c.data_type in ('VARCHAR2', 'CHAR')
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
e:='select null , null , null, null,null,null, null, null, null,null, null, null, null, null, null , null, null, null, null, null, null, null, null , null , null , null , null from dual where rownum < 0 ';
dbms_lob.writeappend(c, length(e),e);
execute immediate to_char(c);
dbms_lob.createtemporary(c, true);
t := 'insert INTO DATA_PROFILE_COL_DTL ';
dbms_lob.writeappend(c,length(t), t);
----date
FOR MYSQLTEXT IN (select
' select a.tname as table_name, a.cname as column_name, rownum as freq_rank, '
|| 'a.column_value as date_column_value, '
|| 'null as integer_column_value, null as number_column_value, null as varchar2_column_value, '
|| ' a.occurs, t.total_rows, round((((a.occurs * 1.0) / (t.total_rows * 1.0)) * 100), 5) as occurs_percent, '
|| ' a.capture_date'
|| ' from ( select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| c.column_name || ' as column_value, '
|| ' count(*) as occurs, sysdate as capture_date'
|| ' from '
|| t.owner || '.' || c.table_name
|| ' group by ' || c.column_name
|| ' order by count(*) desc )a inner join '
|| ' ( select ''' || c.table_name || ''' as tname, count(*) as total_rows from ' || t.owner || '.' || c.table_name || ') t '
|| ' on a.tname = t.tname where rownum <= 100'
|| CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
where c.owner = i.owner
and c.data_type IN ('DATE')
and c.table_name = i.table_name
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
----number
FOR MYSQLTEXT IN (select
' select a.tname as table_name, a.cname as column_name, rownum as freq_rank, '
|| 'null as date_column_value, '
|| 'a.column_value as integer_column_value, null as number_column_value, null as varchar2_column_value, '
|| ' a.occurs, t.total_rows, round((((a.occurs * 1.0) / (t.total_rows * 1.0)) * 100), 5) as occurs_percent, '
|| ' a.capture_date'
|| ' from ( select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| c.column_name || ' as column_value, '
|| ' count(*) as occurs, sysdate as capture_date'
|| ' from '
|| t.owner || '.' || c.table_name
|| ' group by ' || c.column_name
|| ' order by count(*) desc )a inner join '
|| ' ( select ''' || c.table_name || ''' as tname, count(*) as total_rows from ' || c.table_name || ') t '
|| ' on a.tname = t.tname where rownum <= 100'
|| CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
where c.owner = I.OWNER
and c.data_type = 'INTEGER'
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
--integer
FOR MYSQLTEXT IN (select
' select a.tname as table_name, a.cname as column_name, rownum as freq_rank, '
|| 'null as date_column_value, '
|| 'null as integer_column_value, a.column_value as number_column_value, null as varchar2_column_value, '
|| ' a.occurs, t.total_rows, round((((a.occurs * 1.0) / (t.total_rows * 1.0)) * 100), 5) as occurs_percent, '
|| ' a.capture_date'
|| ' from ( select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| c.column_name || ' as column_value, '
|| ' count(*) as occurs, sysdate as capture_date'
|| ' from '
|| t.owner || '.' || c.table_name
|| ' group by ' || c.column_name
|| ' order by count(*) desc )a inner join '
|| ' ( select ''' || c.table_name || ''' as tname, count(*) as total_rows from ' || t.owner || '.' || c.table_name || ') t '
|| ' on a.tname = t.tname where rownum <= 100'
|| CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
where c.owner = I.OWNER
and c.data_type in ('NUMBER', 'DECIMAL')
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
--char and varchar
FOR MYSQLTEXT IN (select
' select a.tname as table_name, a.cname as column_name, rownum as freq_rank, '
|| 'null as date_column_value, '
|| 'null as integer_column_value, null as number_column_value, a.column_value as varchar2_column_value, '
|| ' a.occurs, t.total_rows, round((((a.occurs * 1.0) / (t.total_rows * 1.0)) * 100), 5) as occurs_percent, '
|| ' a.capture_date'
|| ' from ( select '
|| '''' || c.table_name || '''' || ' as tname, '
|| '''' || c.column_name || '''' || ' as cname, '
|| c.column_name || ' as column_value, '
|| ' count(*) as occurs, sysdate as capture_date'
|| ' from '
|| t.owner || '.' || c.table_name
|| ' group by ' || c.column_name
|| ' order by count(*) desc )a inner join '
|| ' ( select ''' || c.table_name || ''' as tname, count(*) as total_rows from ' || t.owner || '.' || c.table_name || ') t '
|| ' on a.tname = t.tname where rownum <= 100'
|| CHR(13) || chr(10) || ' UNION ALL ' AS MYSQL
from sys.all_tab_columns c
inner join sys.all_tables t
on c.table_name = t.table_name
and c.owner = t.owner
where c.owner = I.OWNER
and c.data_type in ('VARCHAR2', 'CHAR')
and c.table_name = I.TABLE_NAME
LOOP
dbms_lob.writeappend(c, length(MYSQLTEXT.MYSQL),MYSQLTEXT.MYSQL);
END LOOP;
e:='select null, null, null, null, null, null, null, null, null, null, null from dual where rownum < 0 ';
dbms_lob.writeappend(c, length(e),e);
execute immediate to_char(c);
end loop;
end;Most likely issue is:
execute immediate to_char(c); TO_CHAR will raise numeric or value error if c exeeds 4000 bytes. What Oracle version you are on? In newer versions execute immediate supports CLOB, so you can chnege the above to:
execute immediate c;Keep in mind, execute immediate has 32K limit on SQL string.
SY. -
Using Table Name reference in formula results in #VALUE error
In Excel 2010, I have an OLE DB connection that brings in data from an SQL query. Excel automatically created the table reference for this (Table1). The table contains headers and Excel knows this; they are formatted in the table as such.
When I try to use a SUMIF function and ask it to sum the column Table1[Column], I get a #VALUE error. I'm assuming because Excel is including the header in the data, which is a text entry. Otherwise, all the other values in the column are numbers.
I'm currently using a defined named range to get round the issue but I'd like to use the table reference instead because as the SQL data grows and shrinks, so does the table range that Excel performs calculations on.Hi DPLMartin,
This should not happen, by default the [column] syntax only refers to the data, not to the header. I expect there is one or perhaps more rows which contain text.
Try selecting the column in question and use F5, Special, constants and only leave the "Text" checkbox checked.
Regards, Jan Karel Pieterse|Excel MVP|http://www.jkp-ads.com -
Rounding value for PR Quantity
Dear Expert,
Can we have rounding value for order quantity in Purchase Requisition? So we do not need to calculate the PO quantity based on the rounding value we have determined in material master / get the error message "Order quantity violates rounding rules while we creating the Purchase order.
And What is rounding profile? can we use this to set the rounding value for PR quantity?
Hope to see ur feedback soon.
Thanks
PaulineHi Dick Hua,
Thanks for your feedback.
i understand what you are trying to explain to me , can we do some changes / customizing from your statement, so that the manually created PR can have effect on rounding value, same as when we run the MRP.
Can you tell me What is rounding profile used for? can I used rounding profile to solve my customizing?
Thanks
Pauline -
PL/SQL: numeric or value error (character string buffer too small)
Hi All,
Below is the procedure used to send notifications. It was working fine in previous DB version :- 10.1.0.5.0 and there was recent upgrade to 11.2.0.2.0.
I complies fine, but when executing it throws the error.
PROCEDURE PROC_STATUS_MAIL_UNADJ IS
K_BOUNDARY CONSTANT VARCHAR2(1000) := 'a1b2c3d4e3f2g1';
l_analysis_report VARCHAR2(32767); --empty_clob; --clob :=
l_header VARCHAR2(1000);
l_footer VARCHAR2(200);
cnxn UTL_SMTP.connection;
cursor cloc is select location_id from locations order by location_id asc;
loc_id cloc%rowtype;
BEGIN
dbms_output.enable (1000000);
FOR loc_id in cloc
loop
l_analysis_report := '<style type="text/css">
<!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #FF0000}-->
<!--.sidebar1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px}-->
<!--.text { font-family: Arial, Helvetica, sans-serif; font-size: 12px}-->
</style>
<center><b><font face="Arial">Run Summary Report'
|| TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI AM') || '<br><br></font></b></center>'
|| ' <div align="center"><table width="95%" border="1" cellspacing="0" cellpadding="1" </div>'
|| '<span style="font-size: 10pt; font-family: Arial"> </span> '
|| '<tr bgcolor=b4b4b4><td align="center"> <font size="3"> <b>'
|| 'Analysis</b></td><td align="center"><font size="3"> <b>'
|| 'Start Time</b></td><td align="center"><font size="3"> <b>'
|| 'End Time</b></td><td align="center"><font size="3"> <b>'
|| 'Run Duration (mins)</b></td><td align="center"><font size="3"> <b>'
|| 'Status</b></font></td></tr> ' || UTL_TCP.CRLF;
FOR curr_refresh IN (SELECT AN.ANALYSIS_ID,AN.NAME ANALYSIS_NAME,TO_CHAR(ARH.RUN_START_TIME,'DD/MM/YYYY HH:MI:SS') START_TIME,
TO_CHAR(ARH.RUN_END_TIME,'DD/MM/YYYY HH:MI:SS')END_TIME,
ROUND(((ARH.RUN_END_TIME-ARH.RUN_START_TIME)*24*60),2) RUN_TIME_SECS,ARH.JOB_STATUS STATUS
FROM
RUN_HISTORY ARH,ANALYSES AN
WHERE
AN.ANALYSIS_ID=ARH.ANALYSIS_ID
AND AN.CYCLE_IND_ID IN (1,3)
AND ARH.RUN_START_TIME>TO_DATE(SYSDATE-30)
AND ARH.JOB_NAME LIKE 'RHS_QU%'
AND AN.LOCATION_ID = loc_id.location_id
AND ARH.JOB_STATUS='Completed'
ORDER BY ARH.RUN_START_TIME DESC)
LOOP
l_analysis_report := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
|| '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
|| curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
'</td><td align="center">'|| curr_refresh.status ||
'</td> </tr>' || UTL_TCP.CRLF;
exit when length (l_analysis_report) > 32500;
END LOOP;
l_analysis_report := l_analysis_report || '</table><br><br>';
l_footer := UTL_TCP.CRLF ||'<b> Note: This is an auto generated email. Please do not reply to it. Contact the IT team for any further information.</b>'|| UTL_TCP.CRLF;
FOR curr_email IN (SELECT GLOBAL_NAME INSTANCE_NAME,
EU.EMAIL_USER_LAST_NAME last_name, EU.EMAIL_USER_FIRST_NAME ACNAME,
EU.EMAIL_USER_EMAIL_ID,loc.LOCATION_NAME LOC_NAME,
'[email protected]' MAIL_FROM
FROM
RHS_EMAIL_USER EU,LOCATIONS LOC,GLOBAL_NAME
WHERE EU.LOCATION_ID=LOC.LOCATION_ID
AND EU.LOCATION_ID=loc_id.location_id
) LOOP
cnxn := UTL_SMTP.open_connection('smtprelay.inc.com', 25);
UTL_SMTP.helo(cnxn, 'smtprelay.inc.com');
UTL_SMTP.mail(cnxn, '[email protected]');
UTL_SMTP.rcpt(cnxn, curr_email.EMAIL_USER_EMAIL_ID);
l_header := 'MIME-Version: 1.0'||'
To: ' || curr_email.last_name || ' <' || curr_email.EMAIL_USER_EMAIL_ID || '>
From: ' || curr_email.mail_from || '
Subject: Un-Adjusted Analysis Report for ' || curr_email.loc_name || ' Location from' || curr_email.instance_name || ' on ' || to_char(sysdate, 'DD-MON-YYYY') || '
Reply-To: [email protected]
Content-Type: text/html;' || UTL_TCP.CRLF || UTL_TCP.CRLF;
UTL_SMTP.data(cnxn, l_header || l_analysis_report || l_footer);
UTL_SMTP.quit(cnxn);
END LOOP;
END LOOP;
END PROC_STATUS_MAIL_UNADJ;
Error :-
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.UTL_SMTP", line 591
ORA-06512: at "SYS.UTL_SMTP", line 497
ORA-06512: at "SYS.UTL_SMTP", line 503
ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 206
ORA-06512: at "RISK_HISTORY.PKG_RHS_EMAIL_NOTIFY", line 414
ORA-06512: at line 2Can you please let me know if there is any issue with code or any upgrade issue ?
Regards,
Sunny
Edited by: k_17 on Oct 13, 2011 12:07 PMHi Helios,
Many thanks for your reply.
I am able to figure out the issue. In the code we have
l_analysis_report := l_analysis_report ||'<tr><td align="center">'|| curr_refresh.analysis_name
|| '</td><td align="center">' || curr_refresh.start_time || '</td><td align="center">'
|| curr_refresh.end_time || '</td><td align="center">'|| curr_refresh.RUN_TIME_SECS ||
'</td><td align="center">'|| curr_refresh.status ||
'</td> </tr>' || UTL_TCP.CRLF;
exit when length (l_analysis_report) > 32500;where "l_analysis_report VARCHAR2(32767);"
The issue is report has more characters, and when executing it throws the error " ORA-06502: PL/SQL: numeric or value error: character string buffer too small ".
Can you please let me know how to have more characters/data in the report. Will CLOB help if yes, please let me know how to use it.
Kindly suggest some options.
Regards,
Sunny -
In formula column - I am getting current year - but get numeric value error
Hello
I defined a formula column as folllows:
function CF_1Formula return char is
thisyear char;
begin
select to_char(sysdate,'YYYY')
into thisyear
from dual;
return thisyear;
end;
I get - Fatal Pl/Sql error. numeric or value error. What am I doing wrong here?Or replace the whole thing with
RETURN to_char(sysdate,'YYYY');
saving a pointless round trip to the database. -
Rounding value at MRP area level
Hi All,
We are using MRP areas at storage location level. Also we have maintained rounding value , one at plant level in mRP1 view and one at MRP area level for that particular storage location.
Now when we run MRP for that storage location specific MRP area one would assume that it picks up the rounding value maintained in that MRp area,but it is picking up the value maintained at plant level.
Am I missing some setting or is it std. system behaviour..pl. advise.
Tks..kiranHi Inguva
Can you give more detail of your solution? I have the same problem, MRP is creating requisitions using the lot size parameters from the MRP area but when converting to an STO using ME21N the lot size parameters from the plant are applied.
This usually increases the PO quantity beyond the PR quantity and I get an error message "06076 - Materials of requisition & item & alr. ordered in full"
It's driving me crazy so any help you can offer would be greatly appreciated.
Thanks
Robyn -
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? -
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 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. -
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 -
Hi everybody,
I have two Distinct Databases on two distinct servers. (Oracle Ent. Release 10.2.0.3.0 on AIX 5.3). After I install the latest patch last week, One of the APEX installation has some problems on Home>Application Builder Page. The error message is very random and
report error:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
When i change the view (details to icons), everything goes to normal. This error message is reflected some of the pages (report region) of some of my applications randomly. When it appears in a report region, i deselect the order method of the region, the result is normal.
But the other APEX application on the other instance has no problem. It is a bug? or Should i re-install the APEX instance?
Thank you for your interest?
Gökhan ÇATALKAYANo, but we have a reproducible test case now so we're working on it. See ORA-06502: PL/SQL: numeric or value error: NULL index table key value
Scott
Maybe you are looking for
-
Does iOS Support Animated GIF's?
Do animated GIF's play on the iPod or iPhone in mobile Safari by default? I know Flash won't & want to make a decision on best way to put a simple animation into a web site. If not any suggestions on what format best to make animations?
-
After downloading Mountain on my MacPro, just installing my MacBook Pro hard disk cracked
Please why?
-
Streaming Video from iPad to TV
This may be a dumb question. I have an original iPad and Apple TV 2G. I would like to play movies from my iPad, via Apple TV, on my TV. When I start a movie on the iPad, and select Apple TV from the drop-down on the iPad, I get audio from my TV but n
-
FM to display Selection screen on report output??
Hi Experts, Is there an FM to display Selection screen on report output. Thanks In Advance.
-
This is just a minor inconvenience. Sometimes text on a stickie go partly blank and then when I click on them the disappeared text comes back and disappears again after clicking out. Has any one encountered this glitch?