下面是我在书上找到的一个例子,目的是通过存储过程写一个简单的网页
可是编译不通,找了半天原因,将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;

解决方案 »

  1.   

    在下接触ORACLE时间不长,只是照书上的例子学着做,书上好像也没写用什么函数包,但我觉得与该函数包有关系。请问这些包怎么用?
      

  2.   

    没有这个包:htp
    你下载一个oracle文档来看:
    Supplied PL/SQL Packages and Types Reference
    http://gigabase.idi.ntnu.no/oradoc/nav/docindex.htm
      

  3.   

    可是该书称:
      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的书
    而且,我在网上的其他一些存储过程中也见到过这个函数包!
      

  4.   

    以下供参考:
    http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/utl_htt2.htm
    还没见过那包.
      

  5.   

    这个包好像跟Oracle WebServer 开发包(又叫做Oracle Web Agent,建成OWA)有关,只是不知道该怎样安装和调用。
      

  6.   

    不知道你的oracle版本是什么,OWS是一套oracle自己的web开发server,有点类似IIS。应该有专门的书介绍oracle的web应用,安装很麻烦。
      

  7.   

    这个是和oracle的oas在一起使用的,oas是oracle提供的一个应用服务器