OWA initialization lost when compiling package

Worker

Member³
It appears that, under certain circumstances, PL/SQL Developer's initialization of the OWA package (for the HTP output tab) gets lost. I have created a small test case to demonstrate.

Given the following package and test script:
Code:
CREATE OR REPLACE PACKAGE Foo AS
X CONSTANT NUMBER := 1;
PROCEDURE Bar;
END;

CREATE OR REPLACE PACKAGE BODY Foo AS
PROCEDURE Bar IS
BEGIN
	htp.prn( 'x' );
END;
END;

Code:
DECLARE
BEGIN
	Foo.Bar;
END;
I have compiled the package, then disconnected. Now when I perform the following steps:
  • Connect
  • Execute the test script
  • (Re-)compile the package in the package window
  • Execute the test script again
I get the following error:
Code:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 323
ORA-06512: at "SYS.HTP", line 860
ORA-06512: at "MY_USER.FOO", line 5
ORA-06512: at line 3
The error can be avoided in two ways:
  • Add calls to OWA.initialize() and OWA.init_cgi_env() to the test script
  • Remove the constant from the package header
I was able to reproduce this on Oracle 8.1.7 and 9.1.0.4.
 
Back
Top