Print Thread
Debug issues using sys.htp.prn
#60068 05/22/19 11:28 PM
Joined: Dec 2002
Posts: 491
Wellington, NZ
Member
OP Offline
Member
Joined: Dec 2002
Posts: 491
Wellington, NZ
Good morning Marco,

I have a package that produces HTP output that I am trying to iron the wrinkles out of. When I am debugging the code, I often have the debug window open (on the HTP Output tab) and the editor open as well so that i can make a quick change and then test it.

After changing the code and compiling, I hit F8 in the test window and i get the following error message:

Code
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 354
ORA-06512: at "SYS.HTP", line 1418
ORA-06512: at "SYS.HTP", line 1494
ORA-06512: at "NOMOSONE_DEV.PKG_MISC", line 1044
ORA-06512: at "NOMOSONE_DEV.RSB_PKG_MGR_IFRS_JOURNAL_ENTRS", line 4562
ORA-06512: at line 3

View program sources of error stack?
Click ok, press F8 again and execution occurs as expected.

This is more a nuisance than anything else (nothing breaks), but what should I be doing to avoid this error?


... suck in your lips and frown like a werewolf ...
Re: Debug issues using sys.htp.prn
rbrooker #60074 05/23/19 08:22 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
I'm not sure what could cause this. Perhaps if you connect as SYS and check line 354 of package body OWA_UTIl and lines 1418 and 1494 of package body HTP you can find a clue?


Marco Kalter
Allround Automations
Re: Debug issues using sys.htp.prn
Marco Kalter #60079 05/23/19 11:25 AM
Joined: Aug 2003
Posts: 54
EE
M
Member
Offline
Member
M
Joined: Aug 2003
Posts: 54
EE
HTP error 6502 has a long history, still unrepaired by Oracle
see, for example, https://muzso.hu/2012/09/05/the-htp...t-work-well-with-multibyte-charactersets


Regards,
Marek
Re: Debug issues using sys.htp.prn
marek #60083 05/23/19 03:21 PM
Joined: Jul 2004
Posts: 592
W
Member
Offline
Member
W
Joined: Jul 2004
Posts: 592
At the top of your test window, add:
Code
htp.HTBUF_LEN := FLOOR(255/4);
This is assuming you use AL32UTF8 as a character set, which uses up to 4 bytes per character. If you use a different character set you can change the "4" to a more appropriate number if you want, but "4" works as well.

The reason this is necessary is due to the following in the sys.htp package header:
Code
HTBUF_LEN number := 255;
type htbuf_arr is table of varchar2(256) index by binary_integer;
This array is defined as 256 bytes, but HTBUF_LEN defines a length in characters. If you use a multi-byte character set, you need to adjust HTBUF_LEN accordingly before you can use the htp package for output.

You can search the internet for "oracle HTBUF_LEN" to get some more information.

Re: Debug issues using sys.htp.prn
Worker #60084 05/24/19 12:27 AM
Joined: Dec 2002
Posts: 491
Wellington, NZ
Member
OP Offline
Member
Joined: Dec 2002
Posts: 491
Wellington, NZ
thank you gentlemen ..


... suck in your lips and frown like a werewolf ...

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.111s Queries: 14 (0.043s) Memory: 2.5289 MB (Peak: 3.0528 MB) Data Comp: Off Server Time: 2024-05-17 09:10:00 UTC
Valid HTML 5 and Valid CSS