ORA-06502:Numeric or value error ORA-01403: No data found --6502
Dear All
I am using Forms 10g.
I am calling a report from my form.
but when i am calling then it is showing this error:
ORA-06502:Numeric or value error ORA-01403: No data found --6502
My code is in Print Button :
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
Add_Parameter(PLid, 'P_Block', Text_Parameter, :block_query.item_block);
Add_Parameter(PLid, 'P_Category', Text_Parameter, :block_query.item_category);
Add_Parameter(PLid, 'P_Dept', Text_Parameter, :block_query.item_dept);
Add_Parameter(PLid, 'P_sub_Category', Text_Parameter, :block_query.item_sub_category);
Add_Parameter(PLid, 'P_FLOOR', Text_Parameter, :block_query.item_floor);
Add_Parameter(PLid, 'P_IP', Text_Parameter, :block_query.item_ip);
Add_Parameter(PLid, 'P_Room', Text_Parameter, :block_query.item_room);
Add_Parameter(PLid, 'P_Userid', Text_Parameter, :block_query.item_usr_id);
Add_Parameter(PLid, 'PARAMFORM', Text_Parameter, 'NO');
repid := FIND_REPORT_OBJECT('rp_report');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracleapps_eHOpeAS');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?
'||'server=rep_oracleapps_eHOpeAS');
Exception
When others then
message(Sqlerrm||'-'||sqlcode);
End;
Edited by: Sandip Mohapatra on Feb 8, 2010 12:44 AM
hi
u can write for all no problem.
here is an example please modify it with u r requirements.
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
add_parameter(plid,'P_code',text_parameter,to_char(:hr.employee_code));
add_parameter(plid,'P_name',text_parameter,to_char(:hr.name));
add_parameter(plid,'P_fname',text_parameter,to_char(:hr.fname));
add_parameter(plid,'P_gender',text_parameter,to_char(:hr.gender));
add_parameter(plid,'P_married',text_parameter,to_char(:hr.marital_status));
add_parameter(plid,'P_job',text_parameter,to_char(:hr.job));
add_parameter(plid,'P_sal',text_parameter,to_char(:hr.sal));
add_parameter(plid,'P_dob',text_parameter,to_char(:hr.dob));
add_parameter(plid,'P_country',text_parameter,to_char(:hr.country));
add_parameter(plid,'P_nationality',text_parameter,to_char(:hr.nationality));
add_parameter(plid,'P_address',text_parameter,to_char(:hr.address));
add_parameter(plid,'p_imagecode',text_parameter,to_char(:images.employee_code));
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REPORT6');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_APPLICATION_PROPERTY(CURSOR_STYLE,'NORMAL');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
/*Display report in the browser*/
WEB.SHOW_DOCUMENT('http://sarah:8890/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver&P_code='||:hr.employee_code||'&P_name'
||:hr.name ||'&P_fname'|| :hr.fname ||'&P_gender'||:hr.gender||'&P_married'||:hr.marital_status||'&P_job'||:hr.job||'&P_sal'||:hr.sal||'&P_dob'||:hr.dob||
'&p_country'||:hr.country||'&p_natioanlity'||:hr.nationality||'&p_address'||:hr.address||'&p_image'||:images.employee_code||'¶mform=no','_SELF');
END;sarah
Similar Messages
-
REP-1401 Fatal PL/SQL error occur ORA-06502 numeric or value error
Hi,
I am getting following error in reports 6i
REP-1401 Fatal PL/SQL error occur ORA-06502 numeric or value error.
I have added a formula column based on other formula column
function CF_1FORMULA0005 return varchar2 is
CF_CREDIT varchar2(38);
begin
:CF_CREDIT:= :D_CARRY_F_CR+:D_HD_SUM_REP_CR;
RETURN (:CF_CREDIT);
end;
Oracle Standard formula coulmn:
function D_CARRY_F_DRFormula return VARCHAR2 is
l_dr VARCHAR2(38);
l_dr_disp VARCHAR2(38);
begin
SRW.REFERENCE(:C_FUNC_CURRENCY);
SRW.REFERENCE(:C_CARRY_F_DR);
if (:C_CARRY_F_DR = 0) THEN
ax_globe_package.g_dr_cf := TRUE;
--l_dr:= '0.00';
l_dr_disp := '0.00';
l_dr := ax_currency_pkg.display_char(:C_FUNC_CURRENCY,l_dr_disp,38);
else
-- return(ax_currency_pkg.display_char(:C_FUNC_CURRENCY,:C_CARRY_F_DR,ax_page_pkg.f_maxlength));
-- Bug2239881. Setting the carried forward totals.
IF (:P_GLOBAL_ATTR_CAT = 'JE.GR.GLXSTBKS.BOOKS' AND ax_globe_package.g_dr_cf = FALSE) THEN
ax_globe_package.g_dr_cf := TRUE;
ax_globe_package.g_dr_total := :C_CARRY_F_DR;
END IF;
srw.message(999,'G_DR_TOTAL = ' || ax_globe_package.g_dr_total );
l_dr := ax_currency_pkg.display_char(:C_FUNC_CURRENCY,to_char(ax_globe_package.g_dr_total),38);
/*select to_number(l_dr, '999G999G999G999G990D00')
into l_dr_disp
from dual;
end if;
srw.message(999,'l_dr = ' || l_dr );
return l_dr;
--return ltrim(to_char(l_dr_disp,'999G999G999G999G990D00','nls_numeric_characters=,.'));
end;
both formula column return types are character.Please help me ASAP.
Thanks,
sriharsha.Hi,
First of all: when you should use concatenation operator (||) instead of plus sign when working with strings. So, instead of
:CF_CREDIT:= :D_CARRY_F_CR+:D_HD_SUM_REP_CR; you should use
:CF_CREDIT:= :D_CARRY_F_CR||:D_HD_SUM_REP_CR; If :D_CARRY_F_CR and :D_HD_SUM_REP_CR are both numbers then consider to use to_char function before you assign value to :CF_CREDIT.
I wonder, why your CF's returns varchar's if they operates on numbers?
regards
kikolus
Edited by: kikolus on 2012-11-30 08:03 -
Error ORA-06502, numeric or value error character to number conversion
I have been trying to create an email including data from a table as part of the body. Whenever I try to send it, I get an error ORA-06502, numeric or value error, character to number conversion. If I take out the part referencing the table, the email will go without error, but if I put it back in I get the error.
There is the code:
DECLARE
v_email_body CLOB;
v_from_email_address VARCHAR2(100) := v('APP_USER');
v_id NUMBER;
BEGIN
v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
Date: '||:P14_PURCHASE_DATE||'
Vendor: '||:P14_VENDOR||'
Invoice Number: '||:P14_INVOICE||'
Invoice Date: '||:P14_INVOICE_DT||'
Due Date: '||:P14_INVOICE_DUE_DT||'
KSR Number: '||:P14_KSR||'
DTS PO: '||:P14_DTS_PO||'
FINANCE DO: '||:P14_FINANCE_PO||'
FOR detail IN(SELECT OB_CODE
FROM BUDGET_USED
WHERE P_ID = :P14_ID)
v_email_body := v_email_body||detail.OB_CODE||utl_tcp.crlf;
LOOP
FOR detail2 IN (SELECT ob_code, amount
FROM budget_used
WHERE p_id = :P14_ID)
LOOP
v_email_body := v_email_body||detail2.ELCID||' - '||detail2.AMOUNT||utl_tcp.crlf;
END LOOP;
END LOOP;
v_email_body := v_email_body
'||:P14_EMAIL_NOTES||'
Thanks.
v_id := APEX_MAIL.SEND
(p_to => :P14_SUBMIT_TO
,p_cc => v('APP_USER')
,p_bcc => '[email protected]'
,p_from => v_from_email_address
,p_body => v_email_body
,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
--Having set up your email, now add one (or more) attachments...
FOR c1 in (SELECT FILENAME
,BLOB_CONTENT
,MIME_TYPE
FROM file_subjects f, apex_application_files a
where a.name = f.name
and f.P_ID = :P14_ID) LOOP
IF c1.blob_content IS NOT NULL THEN
APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
p_attachment => c1.blob_content,
p_filename => c1.filename,
p_mime_type => c1.mime_type);
END IF;
END LOOP;
END;
Apex_mail.push_queue();
This is important to my company to be able to put this data into an email. If anyone can help me, I would greatly appreciate it. Thank you in advance.Lets isolate the erroring line by running the code in debug mode and adding some debug lines at various stages in the code
Apex has a builtin function named wwv_flow.debug which can print messages to the debug stack and would be visible when the page is run in debug mode.
DECLARE
v_email_body CLOB;
v_from_email_address VARCHAR2(100) := v('APP_USER');
v_id NUMBER;
BEGIN
wwv_flow.debug('BEGIN');
v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
Date: '||:P14_PURCHASE_DATE||'
Vendor: '||:P14_VENDOR||'
Invoice Number: '||:P14_INVOICE||'
Invoice Date: '||:P14_INVOICE_DT||'
Due Date: '||:P14_INVOICE_DUE_DT||'
KSR Number: '||:P14_KSR||'
DTS PO: '||:P14_DTS_PO||'
FINANCE DO: '||:P14_FINANCE_PO||'
'||:P14_EMAIL_NOTES||'
Thanks.
wwv_flow.debug('Before sending mail');
v_id := APEX_MAIL.SEND
(p_to => :P14_SUBMIT_TO
,p_cc => v('APP_USER')
,p_bcc => '[email protected]'
,p_from => v_from_email_address
,p_body => v_email_body
,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
wwv_flow.debug('Before attachements');
--Having set up your email, now add one (or more) attachments...
FOR c1 in
(SELECT FILENAME
,BLOB_CONTENT
,MIME_TYPE
FROM file_subjects f, apex_application_files a
where a.name = f.name
and f.P_ID = :P14_ID)
LOOP
IF c1.blob_content IS NOT NULL THEN
APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
p_attachment => c1.blob_content,
p_filename => c1.filename,
p_mime_type => c1.mime_type);
END IF;
END LOOP;
wwv_flow.debug('Finished attachements');
Apex_mail.push_queue();
END;What is the last message you see in the debug after running the page in debug mode and submitting it ? -
Urgent - ORA-06502 numeric or value error in Complex SQL Join
I am having trouble with a tricky bit of code.
I have a complex join query which uses reference cursors.
type search_cursor is ref cursor;
c_result search_cursor;
cursor c_result1 is
select chemicals.*,buildings.building_name,msds.msds,chemical_ras.ra from chemicals,msds,chemical_ras,buildings;
cv_result c_result1%rowtype;
pv_query := 'select chemicals.*,buildings.building_name,msds.msds,chemical_ras.ra from
chem_location_join
right join room_permissions on chem_location_join.room_id = room_permissions.room_id
inner join chemicals on chemicals.chemical_id = chem_location_join.chem_id
inner join cupboards on cupboards.cupboard_id=chem_location_join.cupboard_id
inner join rooms on rooms.room_id=chem_location_join.room_id
inner join buildings on buildings.building_id=chem_location_join.building_id
inner join csr on chemicals.chemical_id=csr.chemical_id
left join msds on msds.csr_id = csr.csr_id
left join chemical_ras on csr.csr_id= chemical_ras.csr_id
where research_group_id = '||pv_research_group_id||' and upper(' || p_search_field || ') LIKE upper(''%' || p_search_entry || '%'') order by chemicals.chemical_name';
Basically,
When the italics are left out, the query runs perfectly. However, when it is put in, it returns the ORA-06502 numeric or value error.
I have run the query in SQL using values in the where clause and it works perfectly. When i replace buildings with other similar elements, i.e. cupboard, room the query returns a similar error.
Sorry if this seems hard to understand, if you need more clarification please reply.
Many Thanks,
Simon
Message was edited by:
SimonHollingsworthno but that shouldn't matter because all that cursor is doing is setting the variable cv_result equal to the same %rowtype, the where clause shouldn't be relevant. in any case I don't have a where clause when the italic bit is left out and it still works fine
-
Error occurred during quick migration: ORA-06502: numeric or value error
I am very beginner on sql developer.I have a problem during a quick migration from mySQL db to Oracle DB as:
step1: captured model processed successful
step2: convered mode processed failed @ ORA-06502: numeric or value error
My work environment:
SQL Developer (2.1.1.64)
Java platform: 1.6.0
Oracle ide:2.1.1
Ojdbc5.jar
Oracle server ver. 9i
mySQL Datatype: datetime (default_value: 0000-00-00 00:00:00) ,float,varchar(100),int(11)
Please help me!
Thanks in advance!
Vien.kgronau wrote:
could you please log into MySQL using mysql-utility, then change to the db (use <your mysql db) and provide the output of
desc bars_eoptHi kgronau,
Thanks for your response. Below is the table "bars_eopt" description from MySQL db. (first row is a description) sorry about the display is not in line as typing.
Field Type Collation Null Key Default Extra Privileges Comment
Bar_Index int(11) NO PRI 0 select,insert,update,references
Recipe varchar(100) latin1_swedish_ci NO MUL select,insert,update,references
Date_Time datetime NO 0000-00-00 00:00:00 select,insert,update,references
ThresholdCurrent float NO 0 select,insert,update,references
SlopeEfficiency float NO 0 select,insert,update,references
Pmax float NO 0 select,insert,update,references
Voltage_at_Imax float NO 0 select,insert,update,references
SeriesResistance float NO 0 select,insert,update,references
PeakWavelength float NO 0 select,insert,update,references
FWHM float NO 0 select,insert,update,references
CentroidWavelength float NO 0 select,insert,update,references
Efficiency_at_Imax float NO 0 select,insert,update,references
ForwardVoltage float NO 0 select,insert,update,references
FW_90_Percent float NO 0 select,insert,update,references
Emitter_at_Ith float NO 0 select,insert,update,references
Emitter_at_Imax float NO 0 select,insert,update,references
Delta_Emitter float NO 0 select,insert,update,references
LOT_ID varchar(100) latin1_swedish_ci NO MUL select,insert,update,references
Part_Number varchar(100) latin1_swedish_ci NO MUL select,insert,update,references
Pak_Number int(11) NO 0 select,insert,update,references
Pak_Position int(11) NO 0 select,insert,update,references
Tracer int(11) NO 0 select,insert,update,references
OCR varchar(100) latin1_swedish_ci NO select,insert,update,references
Inspection_Result varchar(100) latin1_swedish_ci NO select,insert,update,references
Inspection_Defect varchar(100) latin1_swedish_ci NO select,insert,update,references
Facette varchar(1000) latin1_swedish_ci NO select,insert,update,references
Facette2 varchar(1000) latin1_swedish_ci NO select,insert,update,references
Upside varchar(1000) latin1_swedish_ci NO select,insert,update,references
Downside varchar(1000) latin1_swedish_ci NO select,insert,update,references
Thanks again and Best Regards,
Vien.T -
Ora-06502 numeric or value error --urgent
Hai ALL,
In our Application some fields are blank and gives an error 'ora-06502 numeric or value error'. The blanked Fields are taken from another server. Before the error some os booting problem arises and reboot the server. no oracle maintanace and software maintanace done this place. the network connectivity is ok. How the oracle error comes? how to rectify ..please help.. Oracle version is 7..and an urgent matter.
ShijuHi Orashiju,
ORA-06502: PL/SQL: numeric or value error string
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
For more use this link. I am certain you will get an solution.
http://ora-06502.ora-code.com/
Thanks
Shivank -
ORA - 06502 NUMERIC OR VALUE ERROR
Hi,
When i try to compile my below code am getting NUMERIC OR VALUE ERROR.
Here is my code :
CREATE OR REPLACE PACKAGE SendMailJPkg AS
-- EOL is used to separate text line in the message body
EOL CONSTANT STRING(2) := CHR(13) || CHR(10);
TYPE ATTACHMENTS_LIST IS TABLE OF VARCHAR2(4000);
-- High-level interface with collections
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING DEFAULT '',
BccRecipient IN STRING DEFAULT '',
Subject IN STRING DEFAULT '',
Body IN STRING DEFAULT '',
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST DEFAULT NULL) RETURN NUMBER;
END SendMailJPkg;
CREATE OR REPLACE PACKAGE BODY SendMailJPkg AS
PROCEDURE ParseAttachment(Attachments IN ATTACHMENTS_LIST,
AttachmentList OUT VARCHAR2) IS
AttachmentSeparator CONSTANT VARCHAR2(12) := '///';
BEGIN
-- Boolean short-circuit is used here
IF Attachments IS NOT NULL AND Attachments.COUNT > 0 THEN
AttachmentList := Attachments(Attachments.FIRST);
-- Scan the collection, skip first element since it has been
-- already processed;
-- accommodate for sparse collections;
FOR I IN Attachments.NEXT(Attachments.FIRST) .. Attachments.LAST LOOP
AttachmentList := AttachmentList || AttachmentSeparator || Attachments(I);
END LOOP;
ELSE
AttachmentList := '';
END IF;
END ParseAttachment;
-- Forward declaration
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER;
-- High-level interface with collections
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST) RETURN NUMBER IS
AttachmentList VARCHAR2(4000) := '';
AttachmentTypeList VARCHAR2(2000) := '';
BEGIN
ParseAttachment(Attachments,AttachmentList);
RETURN JSendMail(SMTPServerName,
Sender,
Recipient,
CcRecipient,
BccRecipient,
Subject,
Body,
ErrorMessage,
AttachmentList);
END SendMail;
-- JSendMail's body is the java function SendMail.Send()
-- thus, no PL/SQL implementation is needed
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER IS
LANGUAGE JAVA
NAME 'SendMail.Send(java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String[],
java.lang.String) return int';
END SendMailJPkg;
var ErrorMessage VARCHAR2(4000);
var ErrorStatus NUMBER;
-- enable SQL*PLUS output;
SET SERVEROUTPUT ON
-- redirect java output into SQL*PLUS buffer;
exec dbms_java.set_output(5000);
BEGIN
:ErrorStatus := SendMailJPkg.SendMail(
SMTPServerName => 'localhost',
Sender => '[email protected]',
Recipient => '[email protected]',
CcRecipient => '',
BccRecipient => '',
Subject => 'This is the subject line: Test JavaMail',
Body => 'This is the body: Hello, this is a test' ||
SendMailJPkg.EOL || 'that spans 2 lines',
ErrorMessage => :ErrorMessage,
Attachments => SendMailJPkg.ATTACHMENTS_LIST(
'C:\Users\Zahn\Work\sendmail.sql',
'C:\Users\Zahn\Work\ferien-2002.txt'
END;
Can any one please suggest me how to over come this problem ???
Regards,
BharathRaunaq wrote:
This error generally comes , when you try to assign a non-numeric value to a numeric variable
ORA-06502: PL/SQL: numeric or value error Occur's at various instance. The second part of the message exactly stats the reason for this error. Here are few examples.
SQL> declare
2 v number(2);
3 begin
4 v := 123;
5 end;
6 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 4
SQL> declare
2 v number(2);
3 begin
4 v:= 'a';
5 end;
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> declare
2 v varchar2(1);
3 begin
4 v := 'ab';
5 end;
6 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 4
SQL> -
ORA-06502: numeric or value error: character string buffer too small
I have a stored proc with a parameter pio_med_rec_nbr patient.med_rec_nbr%TYPE
where patient.med_rec_nbr is a varchar2(12) .
character set is we8mswin1252 semantics are bytes
the stored proc retrieves max(med_rec_nbr) into nTmp( number) from a reference table
and does pio_med_rec_nbr := lpad(TO_CHAR(nTmp),12,'0')
which throws the ORA-06502: PL/SQL: numeric or value error: character string buffer too smallwhen I check the length, I get length(pio_med_rec_nbr) = 12
I can pass one digit or null but no more. Any idea what I need to do to debug this? I can do xxtmp := lpad(TO_CHAR(nTmp),12,'0') where xxtmp varchar2(255), so I know the assignments are okay.
Thanks,Do, pio_med_rec_nbr := trim(lpad(TO_CHAR(nTmp),12,'0') )
-
ORA-06502: numeric or value error: character to number conversion error
I met the following error when I ran Donald's PL/SQL function to_number_or_null. Could somebody here help me find the resolution? Thanks!
SQL> create or replace FUNCTION to_number_or_null (
2 aiv_number in varchar2 )
3 return number is
4 /*
5 to_number_or_null.fun
6 by Donald J. Bales on 12/15/2006
7 An errorless to_number( ) method
8 */
9 begin
10 return to_number(aiv_number);
11 exception
12 when INVALID_NUMBER then
13 return NULL;
14 end to_number_or_null;
15 /
Function created.
SQL> select to_number_or_null('A') from dual;
select to_number_or_null('A') from dual
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "CAROL.TO_NUMBER_OR_NULL", line 10Only INVALID_NUMBER exception is handled and also VALUE_ERROR should be handeled. You can resolve it by handling VALUE_ERROR exception or by adding WHEN OTHERS as I did in following example.
SQL> create or replace FUNCTION to_number_or_null (
2 aiv_number in varchar2 )
3 return number is
4 /*
5 to_number_or_null.fun
6 by Donald J. Bales on 12/15/2006
7 An errorless to_number( ) method
8 */
9 begin
10 return to_number(aiv_number);
11 exception
12 when INVALID_NUMBER then
13 return NULL;
14 when OTHERS then
15 return null;
16 end to_number_or_null;
17 /
Function created.
SQL> select to_number_or_null('A') from dual;
TO_NUMBER_OR_NULL('A')
----------------------With kind regards
Krystian Zieja -
ORA-06502:numeric or value errORA-04088: error during execution of trigger
I received the following error message while entering a number within the maximum value (i.e. 9,999,999.) allowed in a data entry form which is separate from the base form:
ORA-06502: PL/SQL: numeric or value error:number precision too large ORA-06512:at "<Owner>.<Trigger>", line 194 ORA-04088: error during execution of trigger "<Owner>.<Trigger>"
Where <Owner> is the schema name and <Trigger> is the trigger name. The data block of the entry form is based on a database table, and the sum of all values entered (w/ a maximum value of 99,999,999.) is displayed in the base form. A grand total of this sum along w/ other totals on the base form is also displayed w/ a maximum value defined as 999,999,999. I only receive the above error message when the grand total is greater than 99,999,999. If the grand total is less than or equal to 99,999,999, the base form works fine. Why????
I have verified all the attributes for the database columns and form fields and all seems to be okay, and I am running out of my wits. I am desperately in need of your help in resolving this issue soon because pressure is on...
Thanks in advance for any/all the help.Orchid wrote:
I received the following error message while entering a number within the maximum value (i.e. 9,999,999.) allowed in a data entry form which is separate from the base form:
ORA-06502: PL/SQL: numeric or value error:number precision too large ORA-06512:at "<Owner>.<Trigger>", line 194 ORA-04088: error during execution of trigger "<Owner>.<Trigger>"
Where <Owner> is the schema name and <Trigger> is the trigger name. The data block of the entry form is based on a database table, and the sum of all values entered (w/ a maximum value of 99,999,999.) is displayed in the base form. A grand total of this sum along w/ other totals on the base form is also displayed w/ a maximum value defined as 999,999,999. I only receive the above error message when the grand total is greater than 99,999,999. If the grand total is less than or equal to 99,999,999, the base form works fine. Why????
I have verified all the attributes for the database columns and form fields and all seems to be okay, and I am running out of my wits. I am desperately in need of your help in resolving this issue soon because pressure is on...
Thanks in advance for any/all the help.check your associated database column length. It's precision is not able to hold you said value. increase the length by
ALTER TABLE table_name
MODIFY (column_name NUMBER(20) );it's above solution don't work. Then, probably you use variable in the trigger code which hold the vale and it's size is limited. increase it.
added
try this
increase the length of TAB_S_TOT_COST 9 to 18.
and your problem will solved.
Hamid
Edited by: HamidHelal on Feb 13, 2013 10:28 AM -
ORA-06502 numeric or value error string
Hi,
I have no problem with this code :
select htmldb_item.text(3,nom,20) nom,
htmldb_item.select_list_from_query(9,v_urba_rue.ref_fantoir,'select distinct(nom_voie),v_urba_rue.ref_fantoir from adresse,v_urba_rue where adresse.ref_fantoir(+)=v_urba_rue.ref_fantoir and ref_commune=20 and v_urba_rue.ref_fantoir between 1280 and 1370') rue
from personne,participe,adresse,v_urba_rue
where ...
but when i modify :
...and v_urba_rue.ref_fantoir between 1280 and 1400'') rue...
i have this error :
ORA-06502 PL/SQL: numeric or value error: character string buffer too small
any solution?
thank you very muchHello Zed,
I noticed there are double quotes following the 1400 while in the original query you have the (correct) single quote following the 1370.
Holger ;-) -
I need help with error ORA-06502: numeric or value error
Hi, all, i need help finding the error here, im getting a numeric or value error when i add information to the variable vlcadena when vlcadena is a clob type, and i check the length of the vlcadena variable and sometimes makes the error at 8000 characters some other times 32k i have no idea whats happening, does anyone have a clue?
PROCEDURE REGISTRO_551 (
VPNUMPARTE IN PARTESC.NUMPARTE%TYPE,
VPFRACCION IN IMPOMAT.FRACCIONMEXIMPO%TYPE,
VPDESCRIPCION IN PARTESC.DESCESPANOL%TYPE,
VPVALORDLS IN IMPOMAT.VALORDOLARES%TYPE,
VPCANTIDAD IN IMPOMAT.CANTIDAD%TYPE,
VPUNIMED IN PARTESC.UNIMEDPARTE%TYPE,
VPCANTIDADTARIFA IN IMPOMAT.CANTIDAD%TYPE,
VPVALORAGREGADO IN EXPOPT.VALORAGREGADO%TYPE,
VPPAISORIGEN IN PARTESC.PAISORIGEN%TYPE,
VPCOMPVEND IN PARTESC.PAISORIGEN%TYPE,
VPTIPOFRACCION IN IMPOMAT.TIPOFRACCION%TYPE,
VPPESONETO IN IMPOMAT.PESONETO%TYPE,
VPTIPOMONEDA IN MIMPOMAT.TIPOMONEDAEXTRANJERA%TYPE
) AS
BEGIN
vgproceso := 207310;
vllong2:=length(vlCadena);
vlCadena:=vlCadena||'551'||'|'; --1. TIPO DE REGISTRO
vgproceso := 207311;
vllong2:=length(vlCadena);
vlCadena:=vlCadena||VPFRACCION||'|'; --2. FRACCION
vgproceso := 207312;
vllong2:=length(vlCadena);
QUITA_ENTERS(NVL(VPDESCRIPCION,' '),VLTEMP);
IF LENGTH(VLTEMP)>80 THEN
VLTEMP:=SUBSTR(VLTEMP,1,80);
END IF;
vgproceso := 207313;
vllong2:=length(vlCadena);
IF VLTEMP IS NULL THEN
vlCadena:=vlCadena||'|'; --3. DESCRIPCION
ELSE
vlCadena:=vlCadena||VLTEMP||'|'; --3. DESCRIPCION
END IF;
vgproceso := 207314;
vllong2:=length(vlCadena);
IF VPNUMPARTE IS NULL THEN
vlCadena:=vlCadena||'|';--4. NO. DE PARTE
ELSE
vlCadena:=vlCadena||VPNUMPARTE||'|';--4. NO. DE PARTE
END IF;
vgproceso := 207315;
vllong2:=length(vlCadena);
vlCadena:=vlCadena||VPVALORDLS||'|'; --5. VALOR MERCANCIA
vgproceso := 207316;
vllong2:=length(vlCadena);
vlCadena:=vlCadena||VPCANTIDAD||'|'; --6. CANTIDAD COMERCIAL
vgproceso := 207317;
vllong2:=length(vlCadena);
IF VPUNIMED IS NULL THEN
VPDESCERROR:='ALGUNA PARTIDA CON FRACCION '||VPFRACCION||' NO TIENE UNIDAD DE MEDIDA';
END IF;
vgproceso := 207320;
GET_CATGRAL('ADUANAS','UNIMED',NVL(VPUNIMED,' '),CL_D1,CL_D2,CL_D3,CL_D4,CL_V1,CL_V2,CL_V3,CL_CATG);
IF CL_V2=0 THEN
vlCadena:=vlCadena||VPUNIMED||'|'; --7. UNIDAD MEDIDA COMERCIAL
ELSE
SELECT TO_CHAR(TRUNC(CL_V2)) INTO VLUMCOMERCIAL FROM DUAL;
IF LENGTH(VLUMCOMERCIAL)=1 THEN
VLUMCOMERCIAL:='0'||VLUMCOMERCIAL;
END IF;
vlCadena:=vlCadena||VLUMCOMERCIAL||'|'; --7. UNIDAD MEDIDA COMERCIAL
END IF;
vlCadena:=vlCadena||VPCANTIDADTARIFA||'|';--8. CANTIDAD TARIFA
vlCadena:=vlCadena||VPVALORAGREGADO||'|';--9. VALOR AGREGADO
GET_CATGRAL('ADUANAS','CONFADU','IVIN-REG',CL_D1,CL_D2,CL_D3,CL_D4,CL_V1,CL_V2,CL_V3,CL_CATG);
vlCadena:=vlCadena||CL_D1||'|'; --10. VINCULACION
vlCadena:=vlCadena||CL_D2||'|'; --11. METODO DE VALORACION
vlCadena:=vlCadena||'|'; --12. MARCA
vlCadena:=vlCadena||'|'; --13. MODELOIf the expected maximum length of the concatenated string is less than 32K, then use VARCHAR2 and at the end convert to CLOB if necesary.
:p
PS: At what line in the code does it give the error?
Edited by: LKBrwn_DBA on Aug 20, 2009 2:49 PM -
ORA-06502: numeric or value error, please tell me how to assign ...
Dear all people!
my code:
declare
string1 varchar2(300);
string2 varchar2(65);
begin
string1 := ....
string2 := substr(string1,1,60);
end;
when i run program in debug
at command "string2 := substr(string1,1,60);" it raise error ORA-06502;
Please tell me how to assign substr(string1,1,60) to string2 (max length of string2 is 65);
I'm looking to forward to receiving your response!
Thank you very much;Only INVALID_NUMBER exception is handled and also VALUE_ERROR should be handeled. You can resolve it by handling VALUE_ERROR exception or by adding WHEN OTHERS as I did in following example.
SQL> create or replace FUNCTION to_number_or_null (
2 aiv_number in varchar2 )
3 return number is
4 /*
5 to_number_or_null.fun
6 by Donald J. Bales on 12/15/2006
7 An errorless to_number( ) method
8 */
9 begin
10 return to_number(aiv_number);
11 exception
12 when INVALID_NUMBER then
13 return NULL;
14 when OTHERS then
15 return null;
16 end to_number_or_null;
17 /
Function created.
SQL> select to_number_or_null('A') from dual;
TO_NUMBER_OR_NULL('A')
----------------------With kind regards
Krystian Zieja -
Was working on tutorial from the:
Oracle Database Express Edition 2 Day Plus Application Express Developer Guide
Working on the section 4: How to Control Form Layout.
Ran into a problem trying to compile the Create HT-EMP Table script.
keep getting this error for this particular segment creating the bu_ht_emp trigger:
pp. 4-2 and 4-3
CREATE OR REPLACE TRIGGER bi_ht_emp
BEFORE INSERT ON ht_emp
FOR EACH ROW
BEGIN
SELECT ht_emp_seq.nextval
INTO :new.emp_id
FROM DUAL;
:new.rec_create_date := SYSDATE;
END;
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", line 354....etc
I've check the syntax for the entire script and it all checks out. Does anyone have a clue why this is failing?If I'm looking at the same DDL, not seeing where it would throw an owa_util error, are you running it in the apex script editor?
Just plain sqlplus doesn't like the empty line stuck in with the list of check constraints on the emp_dept column, after fixing that up (and dropping the sequence that got created on the first pass) the DDL and insert runs fine- -
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "package.proc
Hi,
I'm getting the following error , when calling a procedure. Any input appreciated please
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "package.procedure ", line 513
ORA-06512: at line 26
v_counter NUMBER;
v_counter := 0; -- line number 513
FOR i in p_rec_attr.FIRST..p_rec_attr.LAST
LOOP
--IF instr(p_rec_attr(i),'=')<>0 THEN
IF v_counter = 0 THEN
soap_request := soap_request||'<doc:attributes>
<!--Zero or more repetitions:-->
<doc:CategoryAttributeVO>
<!--Optional:-->
<doc:name>'||substr(p_rec_attr(i),1,instr(p_rec_attr(i),'=')-1)||'</doc:name>
<!--Optional:-->
<doc:value>'||substr(p_rec_attr(i),instr(p_rec_attr(i),'=')+1)||'</doc:value>
</doc:CategoryAttributeVO>';
v_counter := v_counter + 1;
ELSE
IF i=p_rec_attr.last THEN
v_category_name := p_rec_attr(i);
soap_request := soap_request||'
</doc:attributes>
<!--Optional:-->
<doc:name>'||v_category_name||'</doc:name>';
v_counter := 0;
ELSE
soap_request := soap_request||'
<!--Zero or more repetitions:-->
<doc:CategoryAttributeVO>
<!--Optional:-->
<doc:name>'||substr(p_rec_attr(i),1,instr(p_rec_attr(i),'=')-1)||'</doc:name>
<!--Optional:-->
<doc:value>'||substr(p_rec_attr(i),instr(p_rec_attr(i),'=')+1)||'</doc:value>
</doc:CategoryAttributeVO>';
v_counter := v_counter + 1;
END IF;
END IF;
--ELSE
--END IF;
END LOOP;
ThanksHi
I tried this which is :
create or replace
procedure test is
v_counter NUMBER;
begin
v_counter := 0; -- line number 513
FOR i in 1..10
LOOP
--IF instr(p_rec_attr(i),'=')0 THEN
IF v_counter = 0 THEN
v_counter := v_counter + 1;
ELSE
IF i=9 THEN
v_counter := 0;
ELSE
v_counter := v_counter + 1;
END IF;
END IF;
END LOOP;
end;
Which does ot throw any error...I think it is being generated from somewhere else
Maybe you are looking for
-
Can i do my personal banking on an ipad the same way i do on my computer
I am interested in buying an ipad but was wondering if i can still do my personal banking on the ipad the same way i do on my computer.
-
Flash8 or Flash CS3 determine what frames and objects use a given library object
I am doing cleanup on a FLA file(a large fla file). I am looking for an easy way to determine where each library item may be used in the given flash document and at what frame and layer it may be used at. Yes I have updated the use counts by selectin
-
How to get data from PostgresSQL to Oracle 11g
I have a general idea on the topic but need more information on the procedure to get data from Postgres (version 8.2 on Linux) database to Oracle 11g (on AIX Unix). Thanks very much in advance!
-
Best way to put the default values for the Form Items
Hi, I am having a form with lot of default values as mentioned below.. Field value created by :APPL_USER creation_date SYSDATE last_updated_by :APPL_USER last_update_date SYSDATE item1
-
DB Table for Purchasing A/P documents
I want to create a report of the latest changes in these week purchase orders but i cannot find where SBO gets it change log. Any Help ?