Ora-06512 Using Sys.Htp Connected to Utf8 Database (Doc ID 760084.1)

Last updated on FEBRUARY 16, 2017

Applies to:

Oracle HTTP Server - Version: 10.1.2.0.0 to 11.1.2.0.0 - Release: AS10gR2 to Oracle11g
Information in this document applies to any platform.

Symptoms

-- Problem Statement:
The SYS.HTP package fails with ORA-06512 in UTF8 database when non-ascii characters referenced.
The failure can occur from the SQL*Plus command line, although this package is meant for use from the Oracle Application Server and will affect related PL/SQL web pages.

-- Steps To Reproduce in SQL*Plus:
Run the following in a SQL session connected to a UTF8 based instance:

set serveroutput on
begin
owa.num_cgi_vars := 0;
htp.init;
htp.htmlopen;
htp.p(rpad('�',128,'�'));
htp.htmlclose;
owa_util.showpage;
end;
/

Errant output:
begin
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.HTP", line 1532
ORA-06512: at "SYS.HTP", line 1735
ORA-06512: at line 5


Changes

Characterset changed to UTF8.
The following query can be used to determine the current characterset.

col parameter format a30
col value format a30
select * from nls_database_parameters
where parameter like '%CHAR%';

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms