下面是我在书上找到的一个例子,目的是通过存储过程写一个简单的网页
可是编译不通,找了半天原因,将htp.print(html)注掉,结果通了,看来就是这句的问题,怎样才能在pl/sql中使用htp函数包呢?
create or replace procedure show_time
as
the_title varchar2(30) := 'what time is it on the server?';
the_time varchar2(20) := to_char(sysdate,'dd-mm-yyyy');
html varchar2(200);
begin
html:= '<html><head><title>'
|| the_title
|| '</title></head><body>';
html := html || 'it is now:' || the_time;
html := html || '</body></html>';
htp.print(html);
end;
可是编译不通,找了半天原因,将htp.print(html)注掉,结果通了,看来就是这句的问题,怎样才能在pl/sql中使用htp函数包呢?
create or replace procedure show_time
as
the_title varchar2(30) := 'what time is it on the server?';
the_time varchar2(20) := to_char(sysdate,'dd-mm-yyyy');
html varchar2(200);
begin
html:= '<html><head><title>'
|| the_title
|| '</title></head><body>';
html := html || 'it is now:' || the_time;
html := html || '</body></html>';
htp.print(html);
end;
你下载一个oracle文档来看:
Supplied PL/SQL Packages and Types Reference
http://gigabase.idi.ntnu.no/oradoc/nav/docindex.htm
pl/sql为网络应用程序提供了一些内置过程
HTP.PRINT(expression);
HTP.PRN(expression);
HTP.PRINTs(expression);
HTP.P(expression);
HTP.PS(expression);
HTP.INIT(expression);
书名叫做《ORACLE PL/SQL 入门》 是O'REILLY的书
而且,我在网上的其他一些存储过程中也见到过这个函数包!
http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/utl_htt2.htm
还没见过那包.