Installation Error HTMLDB 1.6 -- ORA-06502
I get an installation error.
Oracle 10g 10.1.0.2 HTMLDB 1.6.
Does anyone have a tip whats going wrong.
...PAGE 103: Create Application from Scratch
Error creating page validation page=103 name=tab 1-5 name unique ORA-06502:
PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at
"FLOWS_010600.WWV_BIU_STEP_VALIDATIONS", line 20
ORA-04088: error during
execution of trigger 'FLOW
NLS_LANG=AMERICAN_AMERICA.US7ASCII
NLS settings are
SQL> show parameters NLS
NAME TYPE VALUE
nls_calendar string
nls_comp string
nls_currency string
nls_date_format string
nls_date_language string
nls_dual_currency string
nls_iso_currency string
nls_language string AMERICAN
nls_length_semantics string CHAR
nls_nchar_conv_excp string FALSE
nls_numeric_characters string
nls_sort string
nls_territory string AMERICA
nls_time_format string
nls_timestamp_format string
nls_timestamp_tz_format string
nls_time_tz_format string
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
regards
Thorsten
Do you already have a tab 1-5 name unique row in your wwv_flow_step_validation table?
SQL> select * from flows_010600.wwv_flow_step_validations
where validation_name like '%unique%'
SQL>
ID FLOW_ID FLOW_STEP_ID
VALIDATION_NAME
VALIDATION_SEQUENCE
VALIDATION
VALIDATION2
VALIDATION_TYPE
VALIDATION_CONDITION
VALIDATION_CONDITION2
VALIDATION_CONDITION_TYPE
WHEN_BUTTON_PRESSED
ERROR_MESSAGE
ASSOCIATED_ITEM
ERROR_DISPLAY_LOCATION
REQUIRED_PATCH
SECURITY_SCHEME
SECURITY_GROUP_ID
LAST_UPDATED_BY
LAST_UPDA
VALIDATION_COMMENT
2.3810E+17 4000 103
tab 1-5 name unique
100
if (:F4000_T01 is not null) and (:F4000_P4012_DEFAULT_PAGES = '1') then
if :F4000_T01 = :F4000_T02 then
return false;
elsif :F4000_T01 = :F4000_T03 then
return false;
elsif :F4000_T01 = :F4000_T04 then
return false;
elsif :F4000_T01 = :F4000
Similar Messages
-
Report suddenly showing ORA-20001: Error fetching column value: ORA-06502:
Hi,
Some reports in my applications are suddenly showing:
ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
instead iof the data they used to show.
In my development system I can fix this by:
1. changing the column alias in my sql
select 'a' alias1 from dual becomes
select 'a' alias2 from dual
2. SAVE CHANGES
3. change column alias back to original
select 'a' alias2 from dual becomes
select 'a' alias1 from dual
4. reorder columns back to original in the 'report attributes' tab
alias1 is now at the bottom of my colum list - i just bounce it up to column 4 using the up arrows
5. SAVE CHANGES
then everything starts working OK again.
There seems to be nothing wrong with my sql as I can make it works on a new page or after I run the above steps, so I guess something is breaking somewhere but I cannot work out what.
Has anyone else seen this? Does anyone know the cause? Does anyone have a fix for this that does not involve the above steps (plus redeployment to prodcution and all the work that involves)?
I am seeing this on version 2.3 and 3.0.
Thanks,
MartinHi Scott,
I think this is want you want (sorry it's not easy to read):
wp.suite_id - Database Column NUMBER - Report Column Based on LOV
wp.project_id - Database Column NUMBER - Report Column Based on LOV
wp.application_order wp_order - Database Column NUMBER - Report Column Standard
lpad(wp.work_package_id,5,'0')||' - '||wp.name wp_name - Database Column NUMBER/VARCHAR2 - Report Column Standard
pt.application_order pt_order - Database Column NUMBER - Report Column Standard
pt.name pt_name - Database Column VARCHAR2 - Report Column Standard
substr(pt.description,1,30) description - Database Column VARCHAR2 - Report Column Standard
pt.application_tier - Database Column VARCHAR2 - Report Column Based on LOV
pt.application_method - Database Column VARCHAR2 - Report Column Based on LOV
pt.TECH_LEAD_ID - Database Column NUMBER - Report Column Based on LOV
This report has no link columns and no derived columns.
Regards,
Martin -
FRM-40735 on-error raised unhandled exception ORA-06502
Hi there,
I have a form and all the items on canvas are base table items. If iam in normal mode and click on buttons, the LOVs show up correctly.
If i query records and i click on any of buttons to get LOV i get " FRM-40735 on-error raised unhandled exception ORA-06502". I checked insert_allowed,enabled,update_allowed properties and also format mask for each items and all are correct.
ANy help is appreciated.
ThanksUse the debugger to single step through your code line by line. The debugger will stop at the line where the error is occurring. Look at that line of code. You will probably see a problem with a data type or the data length.
-
I have an application made in devlopment which is working fine and i jsut migrated it to production but when i am running one of the page in the app in production it si throwing this error "ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small"... this report is ment for generating report.
Now what i have done, i compared both dev and prod environment but i have not found and changes except this one. In the page of both the application in dev and prod under shared component under under template the region of breadcrum and report region is showing in different position. i dont think it a problem because of that i am facing problem.
If anybody have idea how could i recitfy the prbs i will be highly thankful to you
Regards
Adifriends i have seen where the error is coming but i am unable to trace out how to increase the size of lov which i have made.
when i am taking display as select list(named lov) it is throwing me the error "ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small" but if i am taking display as "popup lov(named lov)" under tablular form element under one of the column in the report, it is working properly. but not shwoing the report the way we want it to show. For that reason i want to increase the size of the love which i have made. -
Error at Script Editor - ORA-06502: PL/SQL: numeric or value error
Hello everyone,
This is my last call for help. I have made some research before i decided to create this thread, trying to find similar problems on the web and on this forum but it seems that this kind of error is associated with another type of situations. In addition, i am pretty new to Oracle DBMS and i do not know how to figure out some problems that happens in this DBMS. This one is very ridiculous because it happens when i load or create a script in Oracle Script Editor. This might be a bug for Oracle Developers figure out and correct for the next releases or updates (or not..).
Working on:
Oracle Database 10g Express Edition (Fresh installation - Yesterday)
Application Express 2.1.0.00.39 (Might be useful information) Windows XP
Problem:
I have a script which allows to create a new database with some tables, relations and data filled in. I go to DB Homepage and login, go to Script Scripts menu and upload the script. I open the script to run it and when the Script Editor load it shows this: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
<table style="display:none;position:absolute;background-color:#EEEEEE;border:#000000 solid 1px;padding:0px;text-align:center;font-size:12px;color:#000000;" summary="" cellpadding="0" cellspacing="0" border="0" id="R138352509674476936">
<tr>
<td class="htmldbWizardHeader">Save Script</td>
<td class="htmldbWizardHeader" align="right"><span><img src="/i/qb/vertical_close.png">
</span></td>
</tr>
<tr>
<td colspan="2" class="htmldbWizardBody">
<div id="saveDialog">A script with this name already exists. Do you wish to overwrite it?</div>
<table summary="" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="right"><input type="button" value="Cancel" class="htmldbButton">
<input type="button" value="Yes" class="htmldbButton">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="right">???</td>
</tr>
</table>
<table summary="">
<tr>
<td></td>
<td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="11141129549203626">
<input type="hidden" name="p_t09" value="" id="OB_OBJECT_NAME">
</td>
<td></td>
<td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="11143605700225196">
<input type="hidden" name="p_t10" value="" id="P0_PPRTIMESTAMP">
</td>
<td width="15">
<div style="width:15px"><br>
</div>
</td>
<td id="htmldbRegion3" class="htmldbTDRight" width="100%" valign="top"></td>
</tr>
</table>
<div id="htmldbRegion4"></div>
<div class="htmldbFlowV">Application Express 2.1.0.00.39</div>
<div class="htmldbNewBottom">
<div class="htmldbNewBottom1">Language: pt</div>
<div class="htmldbNewBottom2">Copyright ? 1999, 2006, Oracle. All rights reserved.</div>
<br style="clear:both;">
</div>
<form><input type="hidden" name="p_md5_checksum" value="">
</form>
<a name="END"><br>
</a> <script language="JavaScript1.1" type="text/javascript">
first_field('P60_SCRIPT_NAME');
</script> The first line seems to be the error: boldORA-06502: PL/SQL: numeric or value error: character string buffer too small*bold*.
However i don't understand why shows the HTML code. Seems to be the code related with the rest of the Oracle DB webpage where the script in filled in (check this two images to understand what i am trying to say: http://img146.imageshack.us/img146/3104/errororacle10g.jpg and http://img180.imageshack.us/img180/5185/scripteditornormal10g.jpg. This is what Script Editor shows on Internet Explorer.
If i login and make the same in another browser the behavior is different. In Firefox the script editor don't show anything and with Chrome i get all the script instructions in a single line (it exceeds the Script Editor) and the Script Editor background turns red: http://img812.imageshack.us/img812/1382/oracleerrorchrome.jpg I tested some scenarios and i got other conclusions: When i try to create a script in the Script Editor, whatever i write (instructions or whatever) when i save and load the file shows the same error. I uploaded the script many times with different File Character Set and the error shows in all situations.
Edited by: 806529 on Nov 1, 2010 3:38 AM
Edited by: 806529 on Nov 1, 2010 3:42 AM
Edited by: 806529 on Nov 1, 2010 3:42 AMThe script that i am trying to run is this: (I think the script is not relevant because many class mates can upload and run it successfully on their Oracle Express 10g installed on Windows 7 or XP)
drop table alunos cascade constraints;
create table alunos (alu_id number(10) not null,
alu_nome varchar2(60) not null,
alu_local varchar2(30),
alu_dnsc date not null,
alu_sexo char(1) not null,
alu_email varchar2(30),
alu_cur_id number(10));
drop table cursos cascade constraints;
create table cursos (cur_id number(10) not null,
cur_nome varchar2(40) not null);
drop table departamentos cascade constraints;
create table departamentos (dep_id number(10) not null,
dep_nome varchar2(60) not null,
dep_sigla char(3) not null);
drop table disciplinas cascade constraints;
create table disciplinas (dis_id number(10) not null,
dis_nome varchar2(40) not null,
dis_creditos number(1) not null,
dis_dep_id number(10));
drop table planoestudos cascade constraints;
create table planoestudos (pla_cur_id number(10) not null,
pla_dis_id number(10) not null,
pla_semestre number(1) not null);
drop table inscricoes cascade constraints;
create table inscricoes (ins_id number(10) not null,
ins_alu_id number(10) not null,
ins_pla_cur_id number(10) not null,
ins_pla_dis_id number(10) not null,
ins_dt_inscricao date not null,
ins_dt_avaliacao date,
ins_nota number(4,2) );
-- Chaves primárias
alter table alunos add constraint pk_alunos primary key (alu_id);
alter table cursos add constraint pk_cursos primary key (cur_id);
alter table departamentos add constraint pk_departamentos primary key (dep_id);
alter table disciplinas add constraint pk_disciplinas primary key (dis_id);
alter table planoestudos add constraint pk_planosestudos primary key (pla_cur_id, pla_dis_id);
alter table inscricoes add constraint inscricoes_pk
primary key (ins_id);
-- Chaves estrangeiras
alter table alunos add constraint alunos_fk_cursos
foreign key (alu_cur_id) references cursos(cur_id);
alter table disciplinas add constraint disciplinas_fk_departamentos
foreign key (dis_dep_id) references departamentos(dep_id);
alter table planoestudos add constraint planoestudos_fk_cursos
foreign key (pla_cur_id) references cursos(cur_id);
alter table planoestudos add constraint planoestudos_fk_disciplinas
foreign key (pla_dis_id) references disciplinas(dis_id);
alter table inscricoes add constraint inscricoes_fk_alunos
foreign key (ins_alu_id) references alunos(alu_id);
alter table inscricoes add constraint inscricoes_fk_planoestudos
foreign key (ins_pla_cur_id,ins_pla_dis_id) references planoestudos(pla_cur_id,pla_dis_id);
-- Sequências
drop sequence seq_alunos;
create sequence seq_alunos increment by 1 start with 1;
drop sequence seq_cursos;
create sequence seq_cursos increment by 1 start with 1;
drop sequence seq_disciplinas;
create sequence seq_disciplinas increment by 1 start with 1;
drop sequence seq_departamentos;
create sequence seq_departamentos increment by 1 start with 1;
-- Informação
insert into cursos values(seq_cursos.nextval,'Engenharia Biomédica');
insert into cursos values(seq_cursos.nextval,'Engenharia Informática');
insert into cursos values(seq_cursos.nextval,'Engenharia Electrónica e Computadores');
insert into cursos values(seq_cursos.nextval,'Engenharia do Ambiente');
insert into alunos values(seq_alunos.nextval,'Joaquim Pires Lopes','lisboa',to_date('85.01.01','YY.MM.DD'),'M','[email protected]',2);
insert into alunos values(seq_alunos.nextval,'Ana Maria Fonseca','Setúbal',to_date('87.03.03','YY.MM.DD'),'F','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'Paula Antunes','Lisboa',to_date('86.07.06','YY.MM.DD'),'F',null,2);
insert into alunos values(seq_alunos.nextval,'Joana Ramalho Silva','Costa da Caparica',to_date('84.09.23','YY.MM.DD'),'F','[email protected]',3);
insert into alunos values(seq_alunos.nextval,'Rui Manuel Silva','Cascais',to_date('84.08.15','YY.MM.DD'),'M','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'João Paulo Santos','Lisboa',to_date('81.11.16','YY.MM.DD'),'M','[email protected]',1);
insert into alunos values(seq_alunos.nextval,'Cristina Fernandes Lopes','Lisboa',to_date('86.01.07','YY.MM.DD'),'F',null,1);
insert into alunos values(seq_alunos.nextval,'Miguel Pinto Leite','Cascais',to_date('74.01.07','YY.MM.DD'),'M','[email protected]',3);
insert into alunos values(seq_alunos.nextval,'Francisco Costa Rosa',null,to_date('78.02.16','YY.MM.DD'),'M',null,4);
insert into alunos values(seq_alunos.nextval,'Elsa Fialho Pinto','Palmela',to_date('79.10.29','YY.MM.DD'),'F','[email protected]',1);
insert into departamentos values(seq_departamentos.nextval,'Departamento de Sistemas e Informática','DSI');
insert into departamentos values(seq_departamentos.nextval,'Departamento de Engenharia Electrotécnica', 'DEE');
insert into departamentos values(seq_departamentos.nextval,'Departamento de Matemática','DEM');
insert into disciplinas values(seq_disciplinas.nextval,'Introducao a Programacao',4,1);
insert into disciplinas values(seq_disciplinas.nextval,'Inteligência Artificial',3,1);
insert into disciplinas values(seq_disciplinas.nextval,'Redes de Computadores',2,1);
insert into disciplinas values(seq_disciplinas.nextval,'Base de Dados',6,1);
insert into disciplinas values(seq_disciplinas.nextval,'Complementos de Base de Dados',2,1);
insert into disciplinas values(seq_disciplinas.nextval,'Análise de Sistemas',1,1);
insert into disciplinas values(seq_disciplinas.nextval,'Sistemas Distribuídos',1,1);
insert into disciplinas values(seq_disciplinas.nextval,'Sistemas Digitais',3,2);
insert into disciplinas values(seq_disciplinas.nextval,'Microprocessadores',2 ,2);
insert into disciplinas values(seq_disciplinas.nextval,'Electrónica Geral',3,2);
insert into disciplinas values(seq_disciplinas.nextval,'Análise Matemática I',4,3);
insert into disciplinas values(seq_disciplinas.nextval,'Análise Matemática II',4,3);
insert into disciplinas values(seq_disciplinas.nextval,'Aplicações Multimédia',6,1);
insert into planoestudos values(1,1,1);
insert into planoestudos values(1,2,4);
insert into planoestudos values(1,3,4);
insert into planoestudos values(1,4,3);
insert into planoestudos values(1,5,5);
insert into planoestudos values(1,6,2);
insert into planoestudos values(1,7,5);
insert into planoestudos values(1,8,6);
insert into planoestudos values(1,11,1);
insert into planoestudos values(2,1,1);
insert into planoestudos values(2,4,5);
insert into planoestudos values(2,8,3);
insert into planoestudos values(2,9,2);
insert into planoestudos values(2,10,1);
insert into planoestudos values(2,11,3);
insert into planoestudos values(3,1,3);
insert into planoestudos values(3,11,4);
insert into planoestudos values(3,12,5);
insert into planoestudos values(4,1,3);
insert into planoestudos values(4,4,4);
insert into planoestudos values(4,11,4);
insert into planoestudos values(4,12,5);
insert into inscricoes values(1,1,2,1,TO_DATE('3-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),10);
insert into inscricoes values(2,1,2,8,TO_DATE('5-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(3,1,2,9,TO_DATE('6-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(4,2,1,1,TO_DATE('23-SEP-2000','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),11);
insert into inscricoes values(5,2,1,11,TO_DATE('23-SEP-2000','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-MAR-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(6,2,1,4,TO_DATE('5-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(7,3,2,1,TO_DATE('5-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),12);
insert into inscricoes values(8,3,2,9,TO_DATE('6-SEP-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(9,4,3,12,TO_DATE('5-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-MAR-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),10);
insert into inscricoes values(10,5,1,1,TO_DATE('7-SEP-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(11,6,1,1,TO_DATE('23-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(12,6,1,11,TO_DATE('23-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(13,7,1,1,TO_DATE('8-SEP-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('10-FEB-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(14,7,1,11,TO_DATE('8-SEP-2001','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('7-MAR-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),17);
insert into inscricoes values(15,7,1,4,TO_DATE('5-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-JUL-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),15);
insert into inscricoes values(16,7,1,2,TO_DATE('5-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-MAR-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),13);
insert into inscricoes values(17,8,3,12,TO_DATE('11-OCT-2005','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-MAR-2006','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),14);
insert into inscricoes values(18,9,4,1,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(19,9,4,11,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(20,9,4,12,TO_DATE('7-OCT-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),null,null);
insert into inscricoes values(21,10,1,11,TO_DATE('11-SEP-2002','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('12-FEB-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),15);
insert into inscricoes values(22,10,1,1,TO_DATE('12-SEP-2003','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),TO_DATE('11-FEB-2004','dd-mon-yyyy','NLS_DATE_LANGUAGE = English'),12);~
commit; -
Error in webi report - ORA-06502
Dear All,
I have create an object in Universe "description" , I am using this object in WEBI report.
When I run the WEBI report I am getting below error:
Database error occurred :the databasr error text is ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1 . (Error: WIS 10901)
This object is working fine in Dev and Quality.
But it is getting above error in the Prod environment in WEBI report.
Actually i think its this "description" object which is the reason
dbms_lob.substr( xyz.DESCRIPTION, 4000, 1 )
Any help is highly appreciatedhello,
yes the DB across the landscapes is same version ...
the failure is due to....see the below test in the field
"cess Code |ZCCONSI| configured "
These 'bar' looking characters are what is causing the failure:
Any ideas on how to fix this.....will string function work at all for this?
Thanks -
Hi,
I knew the reason behind this exception. But my procedure is clean and this exception is thrown, only when i call my procedure for the first time. When I invoke (thru JDBC/ SQLPLUS) the same procedure next time it is executed successfully. I have no clue why this is happening. Has anyone came across such scenario. Any suggestion would be of great help.
Thanks
SanjeevThis error is usually followed by a more detailed error message
Can you post the entire error stack message?
What Oracle version do you use?
Do you use the newest version of the jdbc driver?
http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html -
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 -
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. -
Hi All
Currently I am working on .net based application and Oracle 8.0.6.00 (Multi language Support - (Japanese/English ))as backbend .
The above mention error is occurring from last few days on our production server when user is trying to save data .
I have already gone through all packages and procedure used in my application .
but i didn't find any conversion error .
Main Problem is that some time data is save properly even if error is occurred and some time it not saving data in to the DB. and the same error we are trying to reproduce on development server but it is not reproducing ...
I also checked all NLS Setting of my DB .but still in vague about this error
Can some help me......
Thanks & Regards
Shrirang
Message was edited by:
user528219As you said
Main Problem is that some time data is save properly even if error is occurred
and some time it not saving data in to the DB. and the same error we are trying to
reproduce on development server but it is not reproducing ...
I also checked all NLS Setting of my DB .but still in vague about this error
Can some help me......
Hi Khurram ,
Thanks for reply
the problem is not related any perticular code its big package which we call
to load , modify and save data . i have checked all code . my filed size is 4 time
more then specified size by user for a perticular field.
can you plz. suggest me any other way to solve this
SQL> CREATE OR REPLACE PACKAGE error_06502 AS
2 FUNCTION a RETURN VARCHAR2;
3 END error_06502;
4 .
SQL> /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY error_06502 AS
2 v1 NUMBER:='A';<----------------Damn it is an headache
3 FUNCTION a RETURN VARCHAR2 AS
4 BEGIN
5 RETURN 'No Error';
6 END a;
7 BEGIN
8 DBMS_OUTPUT.PUT_LINE ('Error is going to trapped for assigining variable v1..');
9 EXCEPTION WHEN OTHERS THEN
10 DBMS_OUTPUT.PUT_LINE ('Now error is handled..');
11 END error_06502;
12 .
SQL> /
Package body created.
First time
SQL> EXEC DBMS_OUTPUT.PUT_LINE(error_06502.a);
BEGIN DBMS_OUTPUT.PUT_LINE(error_06502.a); END;
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "SCOTT.ERROR_06502", line 2
ORA-06512: at line 1
Now see here
SQL> EXEC DBMS_OUTPUT.PUT_LINE(error_06502.a);
No Error
PL/SQL procedure successfully completed.See why error showed at first glance but not at second time why??
First Time
Whenever you execute the package first time it initiliased once for each
session,when i run this package first time package initialisation going to first time
and the assignment makes in variable v first time and raise the error though i
have exception block in my executable section which is responsible only to handle
errors that is raised in excutable section.
Second Time
Though package intitliasation is failed at first time (intiliasation dont occur properly
first time) ,Oracle marks the package is initialised and will run continously without
any error and return the string 'No Error' within the lenght of yours session when
you will drop yours session and again try to run the package it will raise the same
error first time
SQL> DISCONNECT
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> CONN scott/tiger
Connected.
SQL> EXEC DBMS_OUTPUT.PUT_LINE(error_06502.a);
BEGIN DBMS_OUTPUT.PUT_LINE(error_06502.a); END;
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "SCOTT.ERROR_06502", line 2
ORA-06512: at line 1.
SQL> SET SERVEROUTPUT ON
SQL> EXEC DBMS_OUTPUT.PUT_LINE(error_06502.a);
No Error
PL/SQL procedure successfully completed.Check your package variable assignment and error handling exception
properly,you had better to make assignment default value in the executable
section rather in the declaration section.In declartion section just declare the
variable but alls assignment should goes at executable section with definging the
exception which will handle the error nicely.
SQL> CREATE OR REPLACE PACKAGE BODY error_06502 AS
2 v1 NUMBER;
3 FUNCTION a RETURN VARCHAR2 AS
4 BEGIN
5 RETURN 'No Error';
6 END a;
7 BEGIN
8 DBMS_OUTPUT.PUT_LINE ('Error is going to trapped for assigining variable v1..');
9 v1:='A';
10 EXCEPTION WHEN OTHERS THEN
11 DBMS_OUTPUT.PUT_LINE ('Now error is handled..');
12 END error_06502;
13 .
SQL> /
Package body created.
SQL> EXEC DBMS_OUTPUT.PUT_LINE(error_06502.a);
Error is going to trapped for assigining variable v1..
Now error is handled..
No Error
PL/SQL procedure successfully completed.----------------------------------------------------------------------------------------------------------------
In my last post there would be another reason for this error i would code it here again..
May be the column you are storing the sequence in is defined as NUMBER2(6) to VARCHAR2(2). Some time ORACLE implicitly convert it if you have valid data in varchar2(2) column like 1,2,3 but if 1A,2A
e.g
SQL> DECLARE
2 a NUMBER(6);
3 BEGIN
4 a:='1';
5 END;
6 .
SQL> /
PL/SQL procedure successfully completed.
SQL> DECLARE
2 a NUMBER(6);
3 BEGIN
4 a:='1a';
5 END;
6 .
SQL> /
DECLARE
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 4If none of these reason which i had mentioned please let us know to share yours
workaround.
Khurram -
ORA-06502: PL/SQL error with dimensions and roles
Hi everyone,
When executing a mapping that loads a cube we are always getting that ORA-06502: PL/SQL error character string buffer too small
The cube contains a number of dimensions, some of them with roles. We've checked that the error appears when we use two different lookup operators to fill dimension atributtes in the cube and its correspondent role. If we map dimension attributes with lookup operator, and the role attributes with constants, the mapping executes without any error. Moreover, even thought it doesnt make any sense, if we map the role dimension attributes with a lookup operator linked to a different dimension, it works too.
We think that this could be due to attributes names, maybe they are too long, but we have tried to make them shorter and still getting the same error.
Any ideas of what could be happening?
Thank you so much in advance.The return datatype in a PLSQL function is unconstrained. Which means it does not have a size.
The size is declared on the receiving end.
What size variable are you trying to return your value into?
Here is an example...
SQL>create or replace function my_func
2 return varchar2
3 is
4 begin
5 return USER;
6 end;
7 /
Function created.
SQL>declare
2 my_string varchar2(30);
3 begin
4 my_string := my_func;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL>declare
2 my_string varchar2(3);
3 begin
4 my_string := my_func;
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 -
Unsual error related to ORA-06502
Hi folks,
I'm trying to insert data into a table with all correct specifications like data-type and data length of the column. But oracle is throwing the message,
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I'm pretty much sure about the data... I cudn't understand the phrase "character string buffer too small".
Can anyone make this clear to me.
I would be invaluably debted to you...
Cheers....PCZOne of your variables holds a value larger than your datatype allows.
Consider:
SQL> VAR x varchar2(2) --- limited to just 2 chars
SQL> BEGIN
:x := 'abc'; --- set 3 chars
END;
Error at line 4
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 2 -
List of Values Rerort error :ORA-06502
Hi,
I have one LOV is query based,
My selected table have between 818 and 2000 rows.
Now, report error:
ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Item Type (Select lisrt query based LOV)
Help !
Regards from Azerbaijan.Mahir - Select list queries are limited as to how much they can return. There are a couple of limits that factor into the formula so I can't give you an exact number of rows. I suggest you use a popup LOV instead, your page will be much lighter.
See:
Re: htmldb_item.select_list causes ORA-06502: PL/SQL: numeric or value erro
Re: Error while associating a report column with a LOV
Scott
Message was edited by:
sspadafo -
Hi,
I am tring to configure upstream replication. I have done reqired configurations of creating stream admin, db link at both source and target. Gettiing following error when i execute folli\owing script.
Script:
========================================================
BEGIN
DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(
schema_names => 'TEST1',
source_database => 'BASE51.REGRESS.RDBMS.DEV.US.ORACLE.COM',
source_directory_object => 'STREAMS_DIR',
destination_database => 'ORCL.LOCALDOMAIN',
destination_directory_object => 'STREAMS_DIR',
include_ddl => TRUE
END;
Error:
==============================================
BEGIN
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 2963
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 6338
ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7524
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2624
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2685
ORA-06512: at line 2
I am unable to find the root cause for above error.
Following are entires created for additional information:
> select script_id,status from DBA_RECOVERABLE_SCRIPT ;
Script ID Status
B4BED3FE81B255EEE040007F01003A84 GENERATING
select * from dba_recoverable_script_errors;no rows selected
select * from DBA_RECOVERABLE_SCRIPT_BLOCKS;no rows selected
Let me know if you need any more info which could helpAny help would be appreciated. Experts please guide me.
-
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>
Maybe you are looking for
-
This is the most recent upgrade to my Firefox version 3.6.8 Mozilla Firefox for Ubuntu canonical - 1.0 Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8 Since then, every web page that makes use of
-
okay so i updated itunes and now it wont let me sync anything it keeps giving me that "you can only be synced with one computer at a time erase and sync" but this is the only computer ive ever used!!! pleeeease help!! <Edited By Host>
-
How to set SAXParser at command-line interface to create a large XML file
Hi, I am trying to create a large XML file (more than 50 MB) by selecting from Oracle database but failed because of "out of memory" error. According to "Oracle XML Developer Guide", we should use SAXParser to parsing a large XML file. But there is n
-
Numeric Filter function in ATS UIBB
Hi Friends, in the ATS uibb the filter does not work for numeric values, only for character values (entries). Is this standard? Gr. Joerg
-
Regarding my payment information made extra
i buy a song from itunes store ,the song cost is 15 rs the thing is it deducted 60+15 total 75