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:
I have compiled the package, then disconnected. Now when I perform the following steps:
The error can be avoided in two ways:
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;
- Connect
- Execute the test script
- (Re-)compile the package in the package window
- Execute the test script again
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
- Add calls to OWA.initialize() and OWA.init_cgi_env() to the test script
- Remove the constant from the package header