ORA-6502, "PL/SQL numeric or value error"
I am having the [ORA-6502, "PL/SQL numeric or value error"] error when I call this procedure in PRE-INSERT trigger.
CREATE OR REPLACE PROCEDURE L_CHECK_BAL_AMOUNT(P_TXN_CODE IN VARCHAR2,
P_ABAL_MAIN_ACNT_CODE IN VARCHAR2,
P_TD_DOC_DRCR_FLAG IN VARCHAR2,
P_TXN_AMOUNT IN NUMBER) IS
CURSOR C1 IS
SELECT TRAN_CASH_BANK_FLAG
FROM FM_TRANSACTION
WHERE TRAN_CODE = P_TXN_CODE;
CURSOR C2 IS
SELECT nvl(SUM(NVL(ABAL_LC_MTD_DR,0)) - SUM(NVL(ABAL_LC_MTD_CR,0)) + SUM(NVL(ABAL_LC_UNP_DR,0)) - SUM(NVL(ABAL_LC_UNP_CR,0)),0)
FROM FS_CUR_ACNT_BAL
WHERE ABAL_MAIN_ACNT_CODE = P_ABAL_MAIN_ACNT_CODE
AND EXISTS (SELECT 'X' FROM FM_MAIN_ACCOUNT
WHERE MAIN_ACNT_CATG IN ('CA','BA')
AND MAIN_ACNT_CODE = ABAL_MAIN_ACNT_CODE)
GROUP BY ABAL_MAIN_ACNT_CODE;
M_BAL_AMOUNT NUMBER(20);
M_CASH_BANK_FLAG OW_FS.FLAG%TYPE;
BEGIN
IF P_ABAL_MAIN_ACNT_CODE IS NOT NULL THEN
insert into temp values('01',P_TXN_CODE);
insert into temp values('02',P_ABAL_MAIN_ACNT_CODE);
insert into temp values('03',P_TD_DOC_DRCR_FLAG);
insert into temp values('04',P_TXN_AMOUNT);
commit;
IF NVL(P_TD_DOC_DRCR_FLAG,'X') = 'C' THEN
insert into temp values('3',P_TD_DOC_DRCR_FLAG);
commit;
IF C1%ISOPEN THEN
CLOSE C1;
END IF;
OPEN C1;
FETCH C1 INTO M_BAL_AMOUNT; --------ERROR HERE-----------
IF C1%FOUND THEN
insert into temp values('2','c1 found');
commit;
END IF;
CLOSE C1;
END IF;
END IF;
END;
can anybody tell me why the error is coming...?
The value for the CURSOR C2 is (-1335142)
Thanks
yes correct. the procedure would have been written like this.(see cursor C1 and C2)
CREATE OR REPLACE PROCEDURE L_CHECK_BAL_AMOUNT(P_TXN_CODE IN VARCHAR2,
P_ABAL_MAIN_ACNT_CODE IN VARCHAR2,
P_TD_DOC_DRCR_FLAG IN VARCHAR2,
P_TXN_AMOUNT IN NUMBER) IS
CURSOR C2 IS
SELECT TRAN_CASH_BANK_FLAG
FROM FM_TRANSACTION
WHERE TRAN_CODE = P_TXN_CODE;
CURSOR C1 IS
SELECT nvl(SUM(NVL(ABAL_LC_MTD_DR,0)) - SUM(NVL(ABAL_LC_MTD_CR,0)) + SUM(NVL(ABAL_LC_UNP_DR,0)) - SUM(NVL(ABAL_LC_UNP_CR,0)),0)
FROM FS_CUR_ACNT_BAL
WHERE ABAL_MAIN_ACNT_CODE = P_ABAL_MAIN_ACNT_CODE
AND EXISTS (SELECT 'X' FROM FM_MAIN_ACCOUNT
WHERE MAIN_ACNT_CATG IN ('CA','BA')
AND MAIN_ACNT_CODE = ABAL_MAIN_ACNT_CODE)
GROUP BY ABAL_MAIN_ACNT_CODE;
M_BAL_AMOUNT NUMBER(20);
M_CASH_BANK_FLAG OW_FS.FLAG%TYPE;
BEGIN
IF P_ABAL_MAIN_ACNT_CODE IS NOT NULL THEN
insert into temp values('01',P_TXN_CODE);
insert into temp values('02',P_ABAL_MAIN_ACNT_CODE);
insert into temp values('03',P_TD_DOC_DRCR_FLAG);
insert into temp values('04',P_TXN_AMOUNT);
commit;
IF NVL(P_TD_DOC_DRCR_FLAG,'X') = 'C' THEN
insert into temp values('3',P_TD_DOC_DRCR_FLAG);
commit;
IF C1%ISOPEN THEN
CLOSE C1;
END IF;
OPEN C1;
FETCH C1 INTO M_BAL_AMOUNT; --------ERROR HERE-----------
IF C1%FOUND THEN
insert into temp values('2','c1 found');
commit;
END IF;
CLOSE C1;
END IF;
END IF;
END;
/
Similar Messages
-
Hi,
I'm trying to create an UI Template. I've generated the html using Frontpage and am successfully able to see in a browser.
I've copied the html to the UI form, but when I try to preview or execute the UI template, I get the following error:
Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-11230)
nullI AM FACING SIMILAR PROBLEM, THE EXACT ERROR IS:
Error: Excepcisn de wwv_generate_component.build_procedure (WWV-01821)
No se ha podido generar la pantalla de interfaz de usuario: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-16409)
(SORRY , PART OF THE ERROR IS IN SPANISH!)
I CREATED A FORM , WORKED WITH IT A LOT WITHOUT PROBLEMS. NOW I NEED TO DO SOME CHANGES ON CERTAIN FIELDS AND WHEN I TRY TO SAVE IT I GET THE ABOVE ERROR.
THEN I GO BACK TO AN OLDER VERSION, COPY AND TRY TO DO CHANGES AND AGAIN THE ERROR COMES UP.
THE CHANGES I AM TRYING TO DO ARE TO SOME OF THE EXISTING FIELDS IN THE FORM WHICH NEED TO BE PUT AS "INSERTABLE".
THE SCREEN LAYOUT IS DISPLAYED WITHOUT PROBLEM.
(THE FORM IS BASED ON A TABLE WITH APROX 80 FIELDS).
I NEED SOME URGENT HELP. PLS LET ME KNOW ANY OTHER INFO YOU MAY NEED TO HELP ME SOLVE THIS PROBLEM.
FYI I AM WORKING ON PORTAL VERSION 3.0.9 / ON Windows 2000 (DATABASE 8.1.7.0 AND iAS ARE ON DIFFERENT MACHINES).
TKS IN ADVANCE -
ORA-6502: PL/SQL: numeric or value error: Character string buffer too small
I then ran the sql in APEX- SQL tool and got the following error
URL Encoded SQL length exceeds 32k limit
Is there a paramter that controls this value or is my only option to shrink the column data in the intractive report ?
Note: Toad renders data for the SQL - only an issue in APEX.
ThanksIssue in APEX, sorry.. You will need to shrink the # of characters you are returning down in your select....
Thank you,
Tony Miller
LuvMuffin Software -
-6502 ORA-06502: PL/SQL: numeric or value error when using 'Create CAPI Definition'
I get an error when I try to create a CAPI definition with Headstart untilities (6i). I use HSU_CAPI revision 6.5.2.0
The detailed information says the following:
Message
BLAPI.OPEN_ACTIVITY
Start HSU_CAPI.run
Number of Tables to create CAPI for 1
Initial checks for table KCS_TENDERS with id 692754610572409851363604771392473242
HSU_CAPT.initial_checks for table KCS_TENDERS
HSU_CAPF.initial_checks for table KCS_TENDERS
HSU_CAPC.initial_checks Custom Services for table KCS_TENDERS
HSU_CAPB.initial_checks BRDD for table KCS_TENDERS
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDIPLS
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
KCS_TENDERS Business Rule Design Definition BR_TNR001_CEV does not have any Trigger Columns. Rule will fire when any column is updated.
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDIPLS
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
bltext.get_line_containing
Creating CAPI for table KCS_TENDERS with id 692754610572409851363604771392473242
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Insert-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Update-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-stmt, Open transaction.
Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Insert-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Update-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Delete-stmt, Close transaction.
Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCODE number of text lines = 6 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-row, Save old data.
Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCODE number of text lines = 404 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Insert, Call CAPI.
Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCODE number of text lines = 4 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Update, Call CAPI.
Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCODE number of text lines = 4 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Delete, Call CAPI.
Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCODE number of text lines = 17 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Insert, Call CAPI.
Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCODE number of text lines = 7 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Update, Call CAPI.
Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCODE number of text lines = 144 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Delete, Call CAPI.
Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCODE number of text lines = 282 - REPLACE
Deleted old text
Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCMNT number of text lines = 1 - REPLACE
Deleted old text
HSU_CAPF.create_or_find_capi_pack
hsu_capi.find_plm (kcs_tnr_capi, 692754610572409851363604771392473242, CAPI).
capi package found in the context folder
BLPLM.UPD
FREE_FORMAT_TEXT_FLAG......... = Y
IMPLEMENTATION_NAME........... = kcs_tnr_capi
PLSQL_MODULE_TYPE............. = PACKAGE
SCOPE......................... = PUBLIC
COMPLETION_STATUS............. = COMPLETED
NAME.......................... = kcs_tnr_capi
PURPOSE....................... = Custom API package for implementing Business Rules and supporting TAPI
Recreated Package KCS/ KCS_TNR_CAPI, preserving only the Revision History.
HSU_CAPF.add_tags_er_av
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
bltext.get_lines_from_repository, p_text_type=CDINOT
bltext.get_line_containing
bltext.get_line_containing
HSU_CAPF.create_specification
HSU_CAPF.create_c_tabalias
HSU_CAPF.create_c_tabalias_all
HSU_CAPF.create_aggregate_value
HSU_CAPF.create_aggregate_value
HSU_CAPF.create_aggregate_value
Activity aborted with ORACLE internal errors.
-6502 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
What can I do about it???
Thanks in advance.
Menno HoogsteenWorking on the same project as Menno, I had the time to look into the problem.
The problem is caused by the creation of the capi-function agregate_char_value in the packages hsu_capf. While creating this function the following code is executed:
add(' -- allowable values:');
add(' -- '||l_col_name_list);
This last statement causes the problem because this table is very big. L_col_name_list contains 2391 characters wich is 393 characters to long. So i changed this code into:
add(' -- allowable values:');
add(' -- '||substr(l_col_name_list,1,1990));
add(' -- '||substr(l_col_name_list,1990));
and everything works fine. Perhaps something for a patch?
Kind regards,
Ruben Spekle -
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> -
ORA-06502: PL/SQL: numeric or value error While Exporting in Oracle 10g
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AR8MSWIN1256 character set and AL16UTF16 NCHAR character set
server uses AR8ISO8859P6 character set (possible charset conversion)
About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. . exporting table DEF$_AQCALL 0 rows exported
. . exporting table SRC_RQST_SEQ 1 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table SRC_USERS 6 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table SRC_YEAR_LOOKUP 40 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TENDER_DETAIL_TABLE 36 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TENDER_MASTER_TABLE 34 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TENDER_NEW_DETAIL_TABLE 4 rows exported
EXP-00091: Exporting questionable statistics.
. exporting synonyms
. exporting views
EXP-00056: ORACLE error 6502 encountered
ORA-06502: PL/SQL: numeric or value error
LPX-00210: expected '<' instead of 'n'
ORA-06512: at "SYS.UTL_XML", line 152
ORA-06512: at "SYS.DBMS_METADATA_INT", line 7195
ORA-06512: at "SYS.DBMS_METADATA_INT", line 9135
ORA-06512: at "SYS.DBMS_METADATA", line 1882
ORA-06512: at "SYS.DBMS_METADATA", line 3707
ORA-06512: at "SYS.DBMS_METADATA", line 3689
ORA-06512: at line 1
EXP-00056: ORACLE error 6502 encountered
ORA-06502: PL/SQL: numeric or value error
LPX-00210: expected '<' instead of 'n'
ORA-06512: at "SYS.UTL_XML", line 152
ORA-06512: at "SYS.DBMS_METADATA_INT", line 7195
ORA-06512: at "SYS.DBMS_METADATA_INT", line 9135
ORA-06512: at "SYS.DBMS_METADATA", line 1882
ORA-06512: at "SYS.DBMS_METADATA", line 3707
ORA-06512: at "SYS.DBMS_METADATA", line 3689
ORA-06512: at line 1
EXP-00000: Export terminated unsuccessfully
Plz reply me the appropriate Solution
Edited by: user8920919 on May 3, 2010 12:27 AMhi,
EXP-00091: Exporting questionable statistics The client character set(NLS_LANG) does not match the server character;
select parameter,value from nls_database_parameters where parameter like '%CHARACTERSET%';
and check the client system character set
- Pavan Kumar N
- ORACLE OCP - 9i/10g
https://www.oracleinternals.blogspot.com -
ORA-06502: PL/SQL: numeric or value error
HI All,
I am facing the following issue and looking forward for help to find the cause.
We are converting PDF documents in our repository to HTML using Oracle API
ctx_doc.ifilter (v_datablob, v_dataclob);
a highly simplified version of our code will be something like this..
1) Create table to store the BLOB(Binary PDF documents)
create table tbl_pdf_store(pdf_doc blob);
2) Insert a row and store a PDF.
3) Convert the PDF into HTML and store it in a CLOB object..
DECLARE
v_datablob BLOB;
v_dataclob CLOB;
BEGIN
--Create temporary clob objects
DBMS_LOB.createtemporary (v_dataclob, TRUE, DBMS_LOB.SESSION);
DBMS_LOB.createtemporary (v_datablob, TRUE, DBMS_LOB.SESSION);
--get the pdf to be converted from store table
SELECT pdf_doc
INTO v_datablob
FROM tbl_pdf_store
WHERE rownum < 1;
--convert the BLOB to HTML and store it in CLOB
ctx_doc.ifilter (v_datablob, v_dataclob);
exception
when others then
dbms_output.put_line(sqlerrm||' - '||sqlcode);
end;
Now the issue I am facing is, the above code works fine for few documents and for few others I get this cryptic error message
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "CTXSYS.DRUE", line 180
ORA-06512: at "CTXSYS.CTX_DOC", line 1142
ORA-06502: PL/SQL: numeric or value error - -6502
I cant reproduce the exact code here, but if anyone had faced the similar issue, then it would be great if they help me out.
thanks,
Prashant> Billy, its not just plain wrong its a sin :). "When
others" should itself be avoided if possible(it just
shows you don't know what error can occur). In the
actual code, we are using separate package to handle
and log errors. Here it was just for simplification I
added that putline code.
Phew.. You had me worried there... :-)
> I ran my procedure in debug mode and it throws this
exception when its executing the Oracle API
ctx_doc.ifilter
And there is very little you can do debugging that, as that source code is encoded (wrapped).
Which means that unfortunately you have to treat that code as a black box and investigate the bug with respects to:
a) the "environment" from which the call is made (ito of session settings, the sequence of calls made, etc)
b) the data and parameters passed
> this is not the case with all the PDFs..I was able to
convert more than 11 thousand documents without any
issues. I have this for only few hundred documents.
This would seem to point to a bug in Oracle's CTX conversion/filter code. Maybe those PDFs are a newer version and is not correctly supported. Maybe they're an older version that is not supported.
Which is why I said you need to isolate the error. Determine which PDFs are failing. Create a test harness (simplified code as you've posted) to perform a conversion (and nothing else).
Determine which PDFs fail and which works. Look at the differences between PDFs. E.g. can those problem PDFs be opened with different Acrobat Reader version - or do some of them fail?
> Another issue is I cannot view the content of the
these documents to check if anything is different :(.
You can with Acrobat Reader.. right?
> so no sure how to go from here...is there a
printstack method in Oracle 9i(similar to 10g I
guess) which can give me more information as I am
currently lost and not sure where to look.
Dumping the stack will not be of much help. In fact, the error message sequence you pasted already show the call sequence. And as these are in Oracle PL/SQL code, there is nothing really you can do about it.
My suggestion is to
a) isolate the error
b) consult the manual(s) to ensure that the Oracle PL/SQL s/w is used correctly
c) determine if this is data related (e.g. different PDF versions for example)
d) log a SR (Service Request) with Oracle Support
The more you can do ito of (a) - (c), the better the chance for finding the root cause, and the quicker resolution when you have no choice but to do (d). -
Difficulty in resolving ORA-06502: PL/SQL: numeric or value error:
Hi
I am having great difficulty to resolve the following error - ORA-06502: PL/SQL: numeric or value error: character string buffer too small . In my Oracle Package, I have a Function that returns a varchar(255).
My Function is basically as follows:
FUNCTION GetUserDept (DeptNum IN NUMBER) RETURN VARCHAR2
IS
deptname varchar(255);
BEGIN
SELECT name INTO deptname
FROM depts
where id = DeptNum;
RETURN deptname
END;
The SQL is running correctly and returns one result, which is what I want. However, when I call the function in my .NET C# code, this is when I am seeing the error message.
In my code, I said that the commandtype is a stored procedure, passed the parameters, and add it to to the parameters, with the return type and direction put first and executed as a scalar. The code executes, and then fails at the ExecuteScalar line, and it is at this point on my exception handler that I see the error message ORA-6502.
This really odd, because I have two other functions that return numbers, and I have executed them in the same way, and theses works!
I have checked my function and can't see what is wrong, and I have tried changing the return type from varchar2 to NVarchar on the return type, but this made no difference.
This problem has really dogged me for hours and I cannot see how to resolve it.
Can someone, please help me?user633278 wrote:
This really odd, because I have two other functions that return numbers, and I have executed them in the same way, and theses works!It is that very reason that your code fails. You need to declare the return variable as a string.
SQL?create or replace
FUNCTION GetUserDept (DeptNum IN NUMBER) RETURN VARCHAR2
IS
deptname varchar(255);
BEGIN
RETURN 'hello world';
END;
2 3 4 5 6 7 8 9 10
Function created.
SQL?
SQL?
declare
x number;
begin
x := GetUserDept(100);
end;
SQL? 2 3 4 5 6 declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 4
SQL?
SQL?
declare
x varchar2(255);
begin
x := GetUserDept(100);
end;
SQL? 2 3 4 5 6
PL/SQL procedure successfully completed. -
ORA-0605: PL/SQL: numeric or value error: character string buffer too small
I get this error on two function activities in a workflow of mine. I don't even get into the pl/sql procedure call.
The exact error is:
Error Name -6502
Error Message: ORA-0605: PL/SQL: numeric or value error: character string buffer too small
Error Stack: @#@Wf_Engine_Util.Function_Call(MY_PACKAGE.MY_PROC, ITEM_TYPE, ITEM_KEY, 6519, RUN)
If I retry the step (expedite -> retry) it runs until it hits the second function which does the same thing (there is a function in between the two functions that do not have any issues). I then have to retry that step as well. Any ideas?
This seems similar to the following issue that does not have a resolution posted:
ORA-06502 PL/SQL numeric or value error in wf process
I've tried commenting out the bodies of the procedures called but that does not help (again -- im not getting into the bodies but im not sure what else it could be).
Any ideas or suggestions?Hi,
Does this happen on every instance of the process, or just a few?
Are these activities in the middle, or right at the start of the flow?
Are any other activities being performed correctly first? If so, are these standard or bespoke?
My inclination would be that there is some kind of variable that is being populated (or concatenated onto), which is growing too big. When the process errors, it gets cleared, which is why an expedite would move the activity on.
Matt
WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
Have you read the blog at http://thoughts.workflowfaq.com ?
WorkflowFAQ support forum: http://forum.workflowfaq.com -
Issue in appending the LOBs -ORA-06502: PL/SQL: numeric or value error
Hi
I am using Oracle 11g.
I have a requirement in which I have to append LOBs and I have to insert the LOB into a table column. I am facing problem when the data exceeds certain limit. My program works like the below:
(please note that my program logic is given below, not the exact program)
DECLARE
final_html CLOB;
int_html CLOB;
v_str VARCHAR2(32767);
i number:=0;
BEGIN
dbms_lob.createtemporary(lob_loc => int_html, CACHE => TRUE, dur => dbms_lob.CALL);
dbms_lob.createtemporary(lob_loc => final_html, CACHE => TRUE, dur => dbms_lob.CALL);
DBMS_LOB.OPEN(int_html, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.OPEN(final_html, DBMS_LOB.LOB_READWRITE);
dbms_output.ENABLE(1000000);
FOR i IN 1..100 loop
v_str := '<tr>' ||
'<td style="WORD-WRAP: break-word" width="50"><font size="2">' ||
i || '</font></td>' ||
'</tr>';
dbms_lob.writeappend(lob_loc => int_html, amount => LENGTH(v_str), BUFFER => v_str);
END LOOP;
dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
dbms_output.put_line( 'The int_html is:'||int_html);
final_html:= '<html>'||int_html||'</html>';
dbms_output.put_line('The final_html is:'||final_html);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLCODE||'-'||SQLERRM);
DBMS_LOB.CLOSE (int_html);
DBMS_LOB.CLOSE (final_html);
DBMS_LOB.FREETEMPORARY(int_html);
DBMS_LOB.FREETEMPORARY(final_html);
END;
when the looping is done for lesser value say for e.g FOR i IN 1..10 loop, the program works fine, but when the looping is done for more values I am getting "-6502-ORA-06502: PL/SQL: numeric or value error" error message.
Please help me to resolve this issue.
Thanking you in advance.
Regards,
SriCan you please specify in which environment you are executing this ?
I modified your code as follows
The code executed successfully until the length was <= 32767 i.e ( until FOR i IN 1..1092)
Also, you need to use the APPEND function to concatenate clob variables.
Please verify the default max size for varchar2 or dbms_output in your server since you get the error for just the loop within the range (FOR i IN 1..100) .
And yes, the comments from Siva are valid.
DECLARE
final_html CLOB;
int_html CLOB;
v_str VARCHAR2(32767);
i number:=0;
BEGIN
dbms_lob.createtemporary(lob_loc => int_html, CACHE => TRUE, dur => dbms_lob.CALL);
dbms_lob.createtemporary(lob_loc => final_html, CACHE => TRUE, dur => dbms_lob.CALL);
DBMS_LOB.OPEN(int_html, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.OPEN(final_html, DBMS_LOB.LOB_READWRITE);
dbms_output.ENABLE(1000000);
FOR i IN 1..1092 loop
v_str := '<tr>' ||
'<td style="">' ||
i || '</td>' ||
'</tr>';
dbms_lob.writeappend(lob_loc => int_html, amount => LENGTH(v_str), BUFFER => v_str);
END LOOP;
dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
begin
dbms_output.put_line( 'The int_html is:'||int_html);
dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
exception when others then
dbms_output.put_line(SQLCODE||'-'||SQLERRM);
end;
begin
final_html:= '<html>'||int_html||'</html>';
dbms_output.put_line('The final_html is:'||final_html);
exception when others then
dbms_output.put_line(SQLCODE||'-'||SQLERRM);
end; */
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLCODE||'-'||SQLERRM);
DBMS_LOB.CLOSE (int_html);
DBMS_LOB.CLOSE (final_html);
DBMS_LOB.FREETEMPORARY(int_html);
DBMS_LOB.FREETEMPORARY(final_html);
END;
Edited by: Jitesh Gurnani on Jul 29, 2011 3:11 AM
Edited by: Jitesh Gurnani on Jul 29, 2011 3:14 AM -
I'm trying to customize my link column on an interactive report to branch to another page in my application based on a pl/sql call. My condition type for the link column is pl/sql function body returning a boolean. I'm calling a packaged function that returns a boolean but receive the following error:
Invalid function body condition: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
This is my code:
return files_util.list_files('test','test');
I've tried running the same code in sqlplus and it works fine. Any help would be appreciated.
Thanks,
RobIt turns out I had multiple issues. I thought the code I was running for the link column would be executed and let me branch to another page to view the results of my pl/sql code. It appears that the pl/sql code for the link column only controls whether the link is displayed or not. The reason for the ora-6502 was because a variable in my pl/sql function was not large enough to hold a value based on the userid signing onto the application. I'm using database authentication so I thought that the userid in apex would be my database userid which is only 4 characters. The userid actually used is apex_public_user which caused by ora-6502 error.
-
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.
Maybe you are looking for
-
whaT IS WITH THE BLACK BACKGROUND AND GREY LETTERS THAT YOU HAVE TO READ ON THE ITUNES STORE?!! WHO IS THE GENIUS THAT THOUGHT THAT WAS A GOOD IDEA?!!! HOW CAN I CHANGE IT TO WHITE??
-
11gR2 Cluster node does not start, start of ora.gipcd fails
Hi I have a clusert node which just does not start, and i do know understand what the problem is. Does anyone have an idea what the problem cound be? I am using Oracle 11.2.0.1.0 on OEL. I appreciate any help, thank you. Regards Bernhard NAME
-
Urgent -Business area assign in Assets ,MM,HR
Hi all, We have implemented FICO,MM,HR modules. If BA is activated in the beginning of next FY, then i guess All Cost center have to be assigned with BA, BA should be assigned to Assets, BA should be assigned to all person number is there any other a
-
How to get illustrator to print like photoshop
Currently running on CC, printing to HP z6800. Majority of the company uses ai files. however, when printing from illustrator, it will not match the colors, and becomes super saturated. however, if I import it to photoshop, it is true to color. Pleas
-
I need to find out what a charge was for?
I need to find out what a charge was for on my account?