Home » Developer & Programmer » Application Express & MOD_PLSQL » how to view procedure in browser written in mod_plsql. (orace XE)
how to view procedure in browser written in mod_plsql. [message #348208] Tue, 16 September 2008 00:46 Go to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

hi,
i have one procedure. script is

PROCEDURE create_user_list
IS
BEGIN
HTP.p('<SELECT NAME="T_USRS" disabled>');
HTP.p('<OPTION value="'||user||'">'||user||'</OPTION>');
HTP.p('</SELECT>');
HTP.br;
HTP.br;
END create_user_list;


when i an trying to extract procedure definition, browser is
interprating htmp tags. code extraction logic is

PROCEDURE get_def (obj_type IN VARCHAR2,
obj_name IN VARCHAR2)
IS
v_script VARCHAR2(32000);
BEGIN
IF ((obj_type IS NULL) OR (obj_name IS NULL)) THEN
HTP.p('please fill desired parameters..!');
ELSE
v_script:= DBMS_METADATA.GET_DDL(obj_type,obj_name,user);
HTP.p('<pre>'||v_script||'</pre>');
END IF;
HTP.anchor('javascript:history.go(-1)','Back');
END get_def;


Current output is attached as image.
Please suggest how can we display object source code on browser.
Re: how to view procedure in browser written in mod_plsql. [message #352383 is a reply to message #348208] Tue, 07 October 2008 07:24 Go to previous message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

Here I would like to share what i did. I simply replace '<' with '&lt;' and '>' with '&gt;'.
It is giving desire result.
 v_script:= dbms_metadata.get_ddl(
                                  obj_type,
                                  obj_name,user
                                 );
 v_script:= replace(v_script,
                         '<',
                      '&lt;'
                    );
 v_script:= replace(v_script,
                          '>',
                       '&gt;'
                    );
 htp.p('<pre>'||v_script||'</pre>');


result is :
Quote:
procedure create_user_list is
begin
htp.p('<SELECT NAME="T_USRS" disabled>');
-- we will drive this space with cursor.
htp.p('<OPTION value="'||user||'">'||user||'</OPTION>');
htp.p('</SELECT>');
HTP.BR;
HTP.BR;
end create_user_list;

Previous Topic: APEX,object browser
Next Topic: Select multiple value in LOV
Goto Forum:
  


Current Time: Mon Sep 22 23:41:48 CDT 2014

Total time taken to generate the page: 0.11792 seconds