ORA-06502/ORA-06512 at execution owa_util.mime_header
Hi, APEX gurus!
I try to write a procedure to display bfile contention /images/ into APEX page.
I have a table :
-TEMP_FLAGS (ID NUMBER(3) NOT NULL, NAME BFILE)
- procedure display_country_flags_bfile
display_country_flags_bfile (p_id NUMBER) is
CURSOR c_flags(p_flag NUMBER) IS
SELECT name
FROM temp_flags_bfile
WHERE id = p_flag;
r_flags c_flags%ROWTYPE;
v_bfile bfile;
lgh_file number;
v_dir_alias varchar2(256);
v_filename varchar2(256);
v_mime varchar2(255);
begin
open c_flags(p_id);
fetch c_flags INTO r_flags;
CLOSE c_flags;
v_bfile := r_flags.name;
dbms_lob.filegetname(v_bfile, v_dir_alias, v_filename);
lgh_file := dbms_lob.getlength(v_bfile);
Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
htp.p('Content-length: '||lgh_file);
htp.p('Content-Disposition: attachment; filename="'||v_filename||'"');
owa_util.http_header_close;
wpg_docload.download_file(v_bfile);
Dbms_Lob.Fileclose(v_bfile);
end display_country_flags_bfile;
If i execute directly in Toad i get error below:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 354
ORA-06512: at "SYS.OWA_UTIL", line 413
ORA-06512: at "STAT.DISPLAY_COUNTRY_FLAGS_BFILE", line 20
ORA-06512: at line 1
In Report attributes of APEX page, i use HTML expression to populate column value as call this procedure with appropriate parameter but image just not showing.
I appreciate any help and opinion.
P.S. I'm a newbie in APEX and have minimal experience.
P.S.2 I forgot - Oracle 10g XE and APEX 2.1 built-in
Thanks, Rado
Edited by: user7637288 on 16-Dec-2008 05:12
Thanks, rafix.
But i'm using Oracle XE with storage limit /1GB/ and i don't want store any images in database. I prefer to use bfile type with link to files on OS level.
By the way , just for tests, i try to use blobs on my own table with simular procedure, which throws the same error - with owa_util.mime_header. And think that the problem is related to owa_util package.
My APEX version is 2.1 - built-in in Oracle XE, not 3.1
Similar Messages
-
EXP-00008, ORA-06502 , ORA-06512 - Export Error
We had done export of schema around 270gb..
exp file=ops4sept.dmp log=ops4sept.log owner='OPS$BBCASHIN' statistics=none buffer=200000000
The following error has come at the end
EXP-00008: ORACLE error 6502 encountered
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 351
ORA-06512: at "SYS.DBMS_SCHED_JOB_EXPORT", line 14
ORA-06512: at line 1
EXP-00085: The previous problem occurred when calling SYS.DBMS_SCHED_JOB_EXPORT.create_exp for object 81203
EXP-00008: ORACLE error 6502 encountered
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 351
ORA-06512: at "SYS.DBMS_SCHED_JOB_EXPORT", line 14
ORA-06512: at line 1
EXP-00085: The previous problem occurred when calling SYS.DBMS_SCHED_JOB_EXPORT.create_exp for object 81202
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.EXP-00085 The previous problem occurred when calling string.string.string for
object number
Cause: The listed package provides export/import support for procedural
objects, i.e., those whose DDL is supplied by stored procedures. The previously
listed error occurred while calling the specified function.
Action: Contact Oracle Support Services. Most packages are supplied by Oracle
internal cartridge or server development groups. The package name will help
Oracle Support Services determine the correct owner of the problem.
Can you trace the session in order to find out the ORA-01031 problem, which could be a missing grant on a table or system privilege -
DBMS_XMLSCHEMA.COPYEVOLVE failing with ORA-06502 ORA-30942 and ORA-30944
Hi all,
We have a procedure we're testing to evolve XML schemas. Fairly simple and straightforward, and on our development box (Win Server 2003) it works fine. However on our test server (Solaris) we get this -
tdm@TDMRSTG>Alter session set RECYCLEBIN=off
2 ;
Session altered.
Elapsed: 00:00:00.00
tdm@TDMRSTG>
1 begin
2 tdm_maintenance_pkg.EVOLVE_SCHEMA(
3 'http://uk-LONDBS006:8080/public/TDM/xsd/TDM_Computation_1_2_3.xsd',
4 'XMLDIR',
5 'evolveTDM_Computation_1.xsd'
6 );
7* end;
tdm@TDMRSTG>/
begin
ERROR at line 1:
ORA-30944: Error during rollback for XML schema 'http://uk-LONDBS006:8080/public/TDM/xsd/TDM_Computa
"TDM"."TDM_COMPUTATION" column 'XML'
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1
ORA-30942: XML Schema Evolution error for schema 'http://uk-LONDBS006:8080/public/TDM/xsd/TDM_Comput
"TDM"."TDM_COMPUTATION" column 'XML'
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 113
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 210
ORA-06512: at "TDM.TDM_MAINTENANCE_PKG", line 47
ORA-06512: at line 2
Elapsed: 00:01:43.03
tdm@TDMRSTG>
Here's the listing of the procedure -
PROCEDURE evolve_schema ( p_oldSchema IN VARCHAR2
, p_directory IN VARCHAR2
, p_newSchema IN VARCHAR2 )
IS
BEGIN
DBMS_XMLSCHEMA.COPYEVOLVE(
xdb$string_list_t(p_oldSchema),
XMLSequenceType(xmltype(getXml(p_Directory,p_newSchema)) )
END;
We're all pretty new to all of this, so any help would be grately appreciated.
Regards
Geoff.Hello
You are selecting 8000 characters from position 4001, not 4000 characters from position 4001....
FUNCTION substr(lob_loc IN BLOB,
amount IN INTEGER := 32767,
offset IN INTEGER := 1)dbms_lob.substr(billing_inventory,4000,1),dbms_lob.substr(billing_inventory,8000,4001)
You need to modify the 2nd substr in each select statement to be
dbms_lob.substr(billing_inventory,4000,1),dbms_lob.substr(billing_inventory,4001,4000)
HTH
David
Edited by: David Tyler on Jun 27, 2011 1:16 PM -
Disco for Oracle Apps with Scheduling not in Apps ~ Throws Error ORA-06502
Hi All,
I have had an SR with Oracle for almost 1/2 year now to set-up scheduling with the scheduling schema not being Apps. They have not been able to fix this yet.
I have used note 757831.1. When I try to set-up a schedule that is recurring, the following error is thrown: ORA-06502.
Does any one have a success story associated with setting-up scheduling in a Disco Oracle Apps end user layer where the scheduling schema is not apps?
Thanks,
Patrick
Edited by: Patrick Bacon on Dec 10, 2010 7:18 AM
Edited by: Patrick Bacon on Dec 10, 2010 8:21 AMPl do not post contents of MOS Docs publicly - this violates terms of your support contract.
We were successful in doing this with Disco 4i a long time ago. I am assuming the process is the same for 10g. Pl see if these MOS Docs can help. Pl post the complete error message.
Error When Trying To Schedule Workbooks: The Batch Repository Schema Must Have Been Granted Direct Access To All Of The Tables Referenced In This Sheet (Doc ID 1125208.1)
How To Store Scheduled Workbooks Results In A Different Schema Other than APPS? (Doc ID 370855.1)
Error When Trying To Schedule Workbooks: The Batch Repository Schema Must Have Been Granted Direct Access To All Of The Tables Referenced In This Sheet (Doc ID 464968.1)
Discoverer Quick Start: Setting Up Workbook Scheduling (Doc ID 74116.1)
Scheduling Workbooks In A Applications Mode EUL Configured With A Batch User Fails With Errors ORA-06502, ORA-06512 (Doc ID 331165.1)
HTH
Srini -
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:pl/sql and ora-06512 at sys.owa_util errors
Greetings -
I have just installed APEX 2.2 in my 9.2.0.7 database and am going through the exercises in the "2 Day+ Application Express Developer's Guide." I was making good progress, until I got to Chapter 5, How to Control Form Layout. I created the script "ht_emp", as instructed. Everything in the script works, except for the "create or replace trigger bi_ht_emp" part. It fails with the following errors:
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", lone 328 ORA-06512: at "SYS.HTP", line 862 ORA-06512: at "SYS.HTP", line 977 ORA-06512: at "SYS.HTP", line 995 ORA-06512: at "FLOWS_020200.WWV_FLOW_SW_API", line 428 ORA-01003: no statement parsed. I have confirmed that nls_length_semantics = BYTE
Any suggestions?
Thanks in advance - GailScott -
Here's the part of the script that chokes --
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;
Thanks fro helping -
Gail -
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- -
Error - ORA-06512: at "SYS.OWA_UTIL" - when trying to download files.
Hi, I have an application where I try to implement download of the attachments.
I am trying to use Denes Kubicek approach
http://apex.oracle.com/pls/otn/f?p=31517:15:4179200867819025:REMOVE_ID:NO::P15_DELETE_ID:4672033519340628563.
When I run stored procedure I get this error message.
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 356
ORA-06512: at "SYS.HTP", line 1368
ORA-06512: at "SYS.HTP", line 1443
ORA-06512: at "SYS.OWA_UTIL", line 413
ORA-06512: at "RPA.LOADATTACHMENT", line 24
ORA-06512: at line 6
The code breaks at :
OWA_UTIL.mime_header (NVL (v_mime, 'application/octet'), FALSE);
Does anybody have any idea why it breaks?
Thanks in advance.
Robert
Edited by: robik on 2-Feb-2011 5:58 AMActually, the error comes up when I try to execute any of these lines:
OWA_UTIL.mime_header (NVL (v_mime, 'application/octet'), FALSE);
-- set the size so the browser knows how much to download
HTP.p ('Content-length: ' || v_length);
-- the filename will be used by the browser if the users does a save as
HTP.p ( 'Content-Disposition: attachment; filename="'
|| REPLACE (REPLACE (SUBSTR (v_file_name,
INSTR (v_file_name, '/') + 1
CHR (10),
NULL
CHR (13),
NULL
|| '"'
Is there any security issue?
Robert -
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 -
Hi,
we are getting error message on the requisition notification form. when the user is logging into apps and opening the requisition approval notification for particular requisition the error messgae is displayed at the top of the notification acreen. though the error message is not preventing the user from approving the requisition. he is successfully able to approve the requistion. but the user doesn't want to seee this error message.
please suggest on how to hide this error message.
error message ------- ORA-06502: PL/SQL: numeric or value error ORA-06512: at "APPS.WF_NOTIFICATION", line 5361 ORA-06512; at line 5
Thanks,
SamDHi,
I wrote about this in 2008 on my blog when I hit the problem in 11.5.9 - http://www.workflowfaq.com/workflow-notification-fails-when-action-history-becomes-too-long
Have a look at the bug, patches and workaround on there and see if that helps solve your problem.
HTH,
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://www.workflowfaq.com/blog ?
WorkflowFAQ support forum: http://forum.workflowfaq.com -
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 -
ORA-06502 PL/SQL: numeric or value error ORA-06512 when calling a procedure
Hi,
I have been using ODP.net for a while now and have been calling lots of procedures without issue, however today I put together one to insert key, value parameters into a simple table and it is failing on me Intermittently with the ORA-06502... I have checked the code and I do not see any problems and am thoroughly frustrated... When I call the procedure directly it all works perfectly so the problem is not in the db!
Please can you help? Code follows:
Table defined as:
CREATE TABLE REPORT_REQUEST_PARAMETERS
( REQUEST_ID NUMBER,
PARAM_NAME VARCHAR2(50 BYTE),
PARAM_VALUE VARCHAR2(255 BYTE)
Stored procedure defined as:
create or replace PROCEDURE SP_WRITE_REQUEST_PARAMS
( in_request_id number, in_param_name char, in_param_value char )
AS
BEGIN
INSERT INTO REPORT_REQUEST_PARAMETERS ( REQUEST_ID, PARAM_NAME, PARAM_VALUE )
VALUES
( in_request_id, in_param_name, in_param_value );
END SP_WRITE_REQUEST_PARAMS;
Finally the ODP.net code which calls this looks like:
using (OracleConnection connection = new OracleConnection(...blah...))
using (OracleCommand command = connection.CreateCommand())
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "SP_WRITE_REQUEST_PARAMS";
OracleParameter p1 = new OracleParameter("in_request_id", OracleDbType.Int32);
OracleParameter p2 = new OracleParameter("in_param_name", OracleDbType.Char);
OracleParameter p3 = new OracleParameter("in_param_value", OracleDbType.Char);
p1.Direction = ParameterDirection.Input;
p1.Value = requestId;
p2.Direction = ParameterDirection.Input;
p2.Size = paramName.Length;
p2.Value = paramName;
p3.Direction = ParameterDirection.Input;
p3.Size = paramValue.Length;
p3.Value = paramValue;
command.Parameters.Add(p1);
command.Parameters.Add(p2);
command.Parameters.Add(p3);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}What version of database? If it's 9206 this is a known database problem, and should be resolved by patching the database to 9208. I don't have the bug number handy though.
Simply because it succeeded in sqlplus doesnt mean it's not a database problem, as the problem was intermittent and succeeded from odp sometimes too.
Thanks
Greg -
Problem with XML in APEX ORA-06502
i, I have a problem with XML generation, I developed an application in APEX, and in a html page I have this process:
declare
l_XML varchar2(32767);
begin
select xmlElement
"iva",
xmlElement("numeroRuc",J.RUC),
xmlElement("razonSocial", J.RAZON_SOCIAL),
xmlElement("idRepre", J.ID_REPRE),
xmlElement("rucContador", J.RUC_CONTADOR),
xmlElement("anio", J.ANIO),
xmlElement("mes", J.MES),
xmlElement
"compras",
select xmlAgg
xmlElement
"detalleCompra",
--xmlAttributes(K.ID_COMPRA as "COMPRA"),
xmlForest
K.COD_SUSTENTO as "codSustento",
K.TPLD_PROV as "tpldProv",
K.ID_PROV as "idProv",
K.TIPO_COMPROBANTE as "tipoComprobante",
to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') as "fechaRegistro",
K.ESTABLECIMIENTO as "establecimiento",
K.PUNTO_EMISION as "puntoEmision",
K.SECUENCIAL as "secuencial",
to_char(K.FECHA_EMISION, 'DD/MM/YYYY') as "fechaEmision",
K.AUTORIZACION as "autorizacion",
to_char(K.BASE_NO_GRA_IVA, 9999999999.99) as "baseNoGraIva",
to_char(K.BASE_IMPONIBLE, 9999999999.99) as "baseImponible",
to_char(K.BASE_IMP_GRAV, 9999999999.99) as "baseImpGrav",
to_char(K.MONTO_ICE, 9999999999.99) as "montoIce",
to_char(K.MONTO_IVA, 9999999999.99) as "montoIva",
to_char(K.VALOR_RET_BIENES, 9999999999.99) as "valorRetBienes",
to_char(K.VALOR_RET_SERVICIOS, 9999999999.99) as "valorRetServicios",
to_char(K.VALOR_RET_SERV_100, 9999999999.99) as "valorRetServ100"
xmlElement
"air",
select xmlAgg
xmlElement
"detalleAir",
xmlForest
P.COD_RET_AIR as "codRetAir",
to_char(P.BASE_IMP_AIR, 9999999999.99) as "baseImpAir",
to_char(P.PORCENTAJE_AIR, 999.99) as "porcentajeAir",
to_char(P.VAL_RET_AIR, 9999999999.99) as "valRetAir"
from ANEXO_COMPRAS P
where P.ID_COMPRA = K.ID_COMPRA
AND P.ID_INFORMANTE_XML = K.ID_INFORMANTE_XML
xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
xmlElement("secRetencion1", K.SEC_RETENCION_1),
xmlElement("autRetencion1", K.AUT_RETENCION_1),
xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
xmlElement("docModificado", K.DOC_MODIFICADO),
xmlElement("estabModificado", K.ESTAB_MODIFICADO),
xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
xmlElement("secModificado", K.SEC_MODIFICADO),
xmlElement("autModificado", K.AUT_MODIFICADO)
from SRI_COMPRAS K
WHERE K.ID IS NOT NULL
AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
AND K.ID BETWEEN 1 AND 25
).getClobVal()
into l_XML
from ANEXO_INFORMANTE J
where J.ID_INFORMANTE =:P3_MES
and J.RUC =:P3_ID_RUC
and J.ANIO =:P3_ANIO
and J.MES =:P3_MES;
--HTML
sys.owa_util.mime_header('text/xml',FALSE);
sys.htp.p('Content-Length: ' || length(l_XML));
sys.owa_util.http_header_close;
sys.htp.print(l_XML);
end;
Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
declare
l_XML CLOB;
begin
--Oculta XML
sys.htp.init;
wwv_flow.g_page_text_generated := true;
wwv_flow.g_unrecoverable_error := true;
--select XML
select xmlElement
from SRI_COMPRAS K
WHERE K.ID IS NOT NULL
AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
).getClobVal()
into l_XML
from ANEXO_INFORMANTE J
where J.ID_INFORMANTE =:P3_MES
and J.RUC =:P3_ID_RUC
and J.ANIO =:P3_ANIO
and J.MES =:P3_MES;
--HTML
sys.owa_util.mime_header('text/xml',FALSE);
sys.htp.p('Content-Length: ' || length(l_XML));
sys.owa_util.http_header_close;
sys.htp.print(l_XML);
end;
The error generated is ORA-06502: PL/SQL: numeric or value error+_
Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+JohannaCevallos07 wrote:
Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
The error generated is ORA-06502: PL/SQL: numeric or value error+_
Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+The likeliest explanation for this is that length of the XML exceeds 32K, which is the maximum size that <tt>htp.p</tt> can output. A CLOB can store much more than this, so it's necessary to buffer the output as shown in +{message:id=4497571}+
Help us to help you. When you have a problem include as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
And always post code wrapped in <tt>\...\</tt> tags, as described in the FAQ.
Thanks -
Package Returning Error ORA-06502: PL/SQL: numeric or value error
Hi,
I create a package to export to spread sheet .xls, The package work for simple query if i pass the query to package.
There is no error in package please create the package and do the following as mentioned below
create or replace
PACKAGE export_pkg_spread_sheet
AS
procedure download_excel(vsql in clob );
PROCEDURE excel_header(p_header in out nocopy clob);
procedure excel_content(p_content in out nocopy clob,
vsql in clob );
procedure excel_footer(p_footer in out nocopy clob);
procedure get_usable_sql (p_sql_in IN clob,
p_sql_out OUT clob);
END export_pkg_spread_sheet;
create or replace
PACKAGE body export_pkg_spread_sheet
AS
PROCEDURE excel_header (p_header IN OUT nocopy CLOB)
AS
BEGIN
p_header := '<html><body>';
END;
procedure download_excel( vsql in clob )
as
p_header clob;
p_footer clob;
p_content clob;
begin
owa_util.mime_header( 'application/octet', FALSE );
htp.p('Content-Disposition: attachment; filename="report.xls"');
owa_util.http_header_close;
excel_header( p_header);
excel_content(p_content,vsql);
excel_footer(p_footer);
dbms_output.put_line(p_header ||p_content|| p_footer);
HTP.PRN( p_header ||p_content|| p_footer);
htmldb_application.g_unrecoverable_error := true;
end;
procedure excel_content(p_content in out nocopy clob,
vsql in clob)
as
p_sql_stmt clob;
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
TYPE varColumn IS TABLE OF varchar2(32000);
vtab varColumn;
v_column_count NUMBER DEFAULT 0;
v_status INTEGER;
BEGIN
htp.prn('am here');
/* SELECT region_source into p_sql_stmt
FROM apex_application_page_regions
WHERE region_id = p_region_id AND
page_id = p_page_id AND
application_id = p_app_id; */
get_usable_sql (vsql,p_sql_stmt);
p_content := p_sql_stmt;
-- Parse the query.
DBMS_SQL.PARSE(cur, p_sql_stmt , DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
p_content := '<table> <tr>';
FOR colind IN 1 .. ncols
LOOP
p_content := p_content || '<td>' || cols(colind).col_name || '</td>';
END LOOP;
p_content := p_content || '</tr>';
vtab := varColumn(null);
for i in 1..ncols
loop
vtab.extend;
DBMS_SQL.DEFINE_COLUMN (cur, i, vtab(i), 2000);
--dbms_output.put_line(vtab(i));
end loop;
v_status := DBMS_SQL.EXECUTE (cur);
LOOP
p_content := p_content || '<tr>';
EXIT WHEN (DBMS_SQL.FETCH_ROWS (cur) <= 0);
FOR i IN 1 ..ncols
loop
DBMS_SQL.COLUMN_VALUE (cur, i, vtab(i));
-- p_content := p_content || '<td>' || 'xyz' || '</td>';
p_content := p_content || '<td>' || vtab(i) || '</td>';
END LOOP;
p_content := p_content || '</tr>' ;
END LOOP;
p_content := p_content || '<table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
exception
when others then
p_content := '<td>Exception Error in printing data</td><table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
end;
procedure excel_footer( p_footer in out nocopy clob)
as
begin
p_footer := '</body></html>';
end;
PROCEDURE get_usable_sql (p_sql_in IN clob, p_sql_out OUT clob)
IS
v_sql clob;
v_names DBMS_SQL.varchar2_table;
v_pos NUMBER;
v_length NUMBER;
v_exit NUMBER;
BEGIN
v_sql := p_sql_in;
v_names := wwv_flow_utilities.get_binds (v_sql);
FOR i IN 1 .. v_names.COUNT
LOOP
<<do_it_again>>
v_pos := INSTR (LOWER (v_sql), LOWER (v_names (i)));
v_length := LENGTH (LOWER (v_names (i)));
v_sql :=
SUBSTR (v_sql, 1, v_pos - 1)
|| v_names (i)
|| SUBSTR (v_sql, v_pos + v_length);
v_sql :=
REPLACE (v_sql,
UPPER (v_names (i)),
'(SELECT v('''
|| LTRIM (v_names (i), ':')
|| ''') FROM DUAL)'
IF INSTR (LOWER (v_sql), LOWER (v_names (i))) > 0
THEN
GOTO do_it_again;
END IF;
END LOOP;
p_sql_out := v_sql;
END;
END export_pkg_spread_sheet;
After creating the package pass the parameter to package like this
begin
export_pkg_spread_sheet.download_excel('select * from emp');
end;
Package will allow to download the spread shreet. If i try to pass the a complex query to package it is returning error as mentioned below
ORA-06502: PL/SQL: numeric or value error
In the above package there is a procedure called procedure excel_content which actuall prints the data in the spread sheet this is where the error is coming from there is a variable called vsql have declared it as clob to hold large string but still i am getting the same error when trying to pass a big string.
Please check the error and let me know.
Thanks
SudhirHi Praveen,
This is the query i am using to pass
Declare
qry clob;
Begin
qry := ' 'SELECT
AR.REGION_CODE,
AR.DISTRICT_CODE,
AR.TERRITORY_CODE,
CASE
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.REGION_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.DISTRICT_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NOT NULL THEN
AR.TERRITORY_NAME
END TERR_NAME,
AR.EMPLOYEE_ID,
AR.LAST_NAME,
AR.FIRST_NAME,
AR.GENDER,
AR.DATE_OF_HIRE,
AR.PROJECT_EMPLOYEE_TITLE_ID,
AR.COMPANY_ID,
AR.CUSTOMER_EMAIL,
AR.BUSINESS_EMAIL,
AR.CUSTOMER_VOICEMAIL,
AR.CUSTOMER_VOICEMAIL_EXT,
AR.QUINTILES_VOICEMAIL,
AR.QUINTILES_VOICEMAIL_EXT , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ZipCode" FROM AR_V_ROSTER AR
LEFT JOIN AR_V_ADDRESS_HISTORY AAH
ON
(AR.PROJECT_ID = AAH.PROJECT_ID AND
AR.EMPLOYEE_ID = AAH.EMPLOYEE_ID)
WHERE
UPPER(AR.USER_EMPLOYEE_ID) = ''Q766730'' AND
AR.PROJECT_ID = 81 ';
export_pkg_spread_sheet.download_excel(qry);
End;
Praveen you can pass your DB table query to check the error. I am trying to pass as mentioned above.
Please let me know if my question is not clear.
Thanks
Sudhir -
ORA-06502 - Error when running "Ask The Expert 0.9"
Hi ,
I successfully installed "Ask the Expert" package with Apex 3.0 on Oracle 10g Database 10.2.0.1.0. No error ocurred during the import in my Apex environment.
Besides that, i'm having problems when i tried to run the "Aks the Expert". It always shows the following message errors:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Error Unable to write activity log.
I think it was a problem with APEX instalation, but i could run the Sample Application of Apex without any problem.
I opened an SR in Metalink, but to my surprise, the analist of support don't know what's wrong with the demo "Ask de Expert".
The debug function of the application show the following commands before the error ocurrs:
0.01:
0.01: S H O W: application="103" page="1" workspace="" request="" session="6648566035252817"
0.01: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
0.01: alter session set nls_language="AMERICAN"
0.01: alter session set nls_territory="AMERICA"
0.01: NLS: CSV charset=WE8MSWIN1252
0.01: ...NLS: Set Decimal separator="."
0.01: ...NLS: Set NLS Group separator=","
0.02: ...NLS: Set date format="DD-MON-RR"
0.02: ...Setting session time_zone to -03:00
0.02: NLS: Language=en-us
0.02: Application 103, Authentication: CUSTOM2, Page Template: 667896385843019243
0.02: ...Determine if user "N3COUTINHO" workspace "951808960237899" can develop application "103" in workspace "951808960237899"
0.02: ...ok to reuse builder session for user:nobody
0.03: ...Application session: 6648566035252817, user=nobody
0.03: ...Determine if user "N3COUTINHO" workspace "951808960237899" can develop application "103" in workspace "951808960237899"
0.03: Session: Fetch session header information
0.03: ...Metadata: Fetch page attributes for application 103, page 1
0.03: Fetch session state from database
0.03: Branch point: BEFORE_HEADER
0.03: Fetch application meta data
0.04: Computation point: BEFORE_HEADER
0.04: ...Perform computation of item: P1_CLEAN_CRITERIA, type=FUNCTION_BODY
0.04: ...Performing function body computation
0.06: ...Session State: Save "P1_CLEAN_CRITERIA" - saving same value: ""
0.06: Processing point: BEFORE_HEADER
0.06: ...Process "Read and Write Activity Cookie": PLSQL (BEFORE_HEADER) declare l_cookie_id number; begin owa_util.mime_header('text/html', FALSE); -- ate_api.read_activity_cookie; l_cookie_id := ate_api.fetch_activity_cookie_val( 'COOKIE_ID' ); -- if l_cookie_id is null then l_cookie_id :=
Content-type: text/html; charset=ISO-8859-1 Set-Cookie: activity_ask_expert=1|2400346189796; expires=Wed, 01-Jan-2020 08:00:00 GMT; path=/;
0.06: Encountered unhandled exception in process type PLSQL
0.06: Show ERROR page...
0.06: Performing rollback...
Please, could any one help me to solve this problem ? Metalink couldn't help me diagnosing what's wrong.
Thanks,
Sergio CoutinhoHi,
I don´t know if it help the analisis, but i collect some informations about my environment:
1) HTML DB version
3.0.1
2) Database version
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
3) Database server operating system (as well, if 32-bit or 64-bit)
Solaris 5.9 - 64 bits
4) Database Parameters:
PARAMETER VALUE
NLS_CALENDAR GREGORIAN
NLS_CHARACTERSET WE8ISO8859P1
NLS_COMP BINARY
NLS_CURRENCY $
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_DUAL_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_LANGUAGE AMERICAN
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_NCHAR_CONV_EXCP FALSE
NLS_NUMERIC_CHARACTERS .,
NLS_RDBMS_VERSION 10.2.0.1.0
NLS_SORT BINARY
NLS_TERRITORY AMERICA
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
Could it explain why ASK THE EXPERT is running on hosted apex site and it´s
generating error when running in my environment?
Thanks for the help !
Sergio
Maybe you are looking for
-
Creating "A" record in Cisco 1841
Hello All, We are using Cisco 1841 router. Our requirement is to configure "A" record in the router i.e. we wanted this router to act as a Primary DNS server. I can bit explain the scenario. We have connected Internet Lease line ILL to this router wi
-
We have two - three inspection type . i.e need to be assigned in the material master . which setting i need to adopt in the selection and the prefered inspection type ? if we have multiple inspection plan for a single material , is it possible to cr
-
im looping through databases on a server & building a connection string to each database. $SQLConn.ConnectionString = "Server=$SrvName; Database=$DBName; User ID =DBLogin; Password=myPassword;" The problem is i get this error: Only variable names (i
-
My printer is wasting paper using sometimes up to 20 pages to print a single page document. It prints a smal portion of the document then spits out that sheet and contiues where it left off on the new sheet.I have checked all my settings and everyth
-
I used to be able to select British female accent for my iPhone 4. Is this not possible anymore?