无需编译,oracle就是提供数据存储。如果调用了oracle的后台存储过程,在移植的时候,一般是import时,就生成了。

解决方案 »

  1.   

    Create Or Replace Package updown  Is 
      Procedure  write_info     (
                                 who in varchar2,
                                 description in varchar2,
                                 file in varchar2 ) ;
      procedure download(file_name in varchar2);  
      procedure html;     
     
    End;
    /
    show  errors;Create Or Replace Package body updown   as  Procedure  write_info    (
                                who in varchar2,
                                description in varchar2,
                                file in varchar2 ) as
       begin
    htp.htmlopen;
    htp.headopen;
    htp.title('File Uploaded');
    htp.headclose;
    htp.bodyopen;
    htp.header(1,'Upload Status');
    htp.print('Uploaded ' || file ||' successfully');
    commit;    htp.bodyclose;
    htp.htmlclose;
    commit;
     end ;  
     
    procedure download(file_name in varchar2) is
        content_type varchar2(50) default null;
      begin
        htp.p('<html>');
        htp.p('<head>');           select mime_type into content_type from doccontent where name=file_name;           htp.p('</head>');
        htp.p('<body>');        wpg_docload.download_file(file_name);
        
        htp.p('</body>');    
        htp.p('</html>');  end download;
     
     procedure html  is  
     
     begin 
     htp.p(' <html>
             <head>
            <title>test upload</title>
           </head>
             <body>
           <FORM enctype="multipart/form-data" action="updown.write_info" method="POST">
          <p>Author’s Name:<INPUT type="text" name="who">
         <p>Description:<INPUT type="text" name="description"><br>
     <p>File to upload:<INPUT type="file" name="file"><br>
     <p><INPUT type="submit">
     </FORM>
     </body>
     </html>  ');
     
     end ;
    end ;   
    /
    show  errors;