Popup document through PL/SQL Procedure

Hi, I am wandering howcome we popup any document, sitting on my server ,through a PL/SQL procedure. I do not want to read the content of that document, which we can do through UTL_FILE, but want to open that document. I have the URL(,location) of the document ,but just don't know how I can open this document with URL, in PL/SQL.
So, help me out. Thanks.

Reading a web page using PLSQL is really easy.
If you are running 10g, skip this ACL prerequisite and jump to the code below.
If you are running 11g, there are a couple of housekeeping prerequisites. You need to create the network ACLs in the database to allow access to the pages you are interested in. Like this:
BEGIN
      -- create the ACL
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
         acl          => 'oreillynet-permissions.xml'
        ,description  => 'Network permissions for www.oreillynet.com'
        ,principal    => 'SYSTEM'
        ,is_grant     => TRUE
        ,privilege    => 'connect'
        ,start_date   => SYSTIMESTAMP
        ,end_date     => NULL
      -- assign privileges to the ACL
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (
          acl        => 'oreillynet-permissions.xml'
         ,principal  => 'SYSTEM'
         ,is_grant   => TRUE
         ,privilege  => 'connect'
         ,start_date => SYSTIMESTAMP
         ,end_date   => null
      -- define the allowable destintions
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
          acl        => 'oreillynet-permissions.xml'
         ,host       => 'www.orillynet.com'
         ,lower_port => 80
         ,upper_port => 80
    END;Here is the code to read the web page:
DECLARE
   WebPageURL HttpUriType;
   WebPage CLOB;
BEGIN
   --Create an instance of the type pointing
   --to Arup Nanda's Author Bio page at OReilly
   WebPageURL := HttpUriType.createUri('http://www.oreillynet.com/pub/au/2307');
   --Retrieve the web page via HTTP
   WebPage := WebPageURL.getclob();
   --Display the page title
   DBMS_OUTPUT.PUT_LINE(regexp_substr(WebPage,'<title>.*</title>'));
END;
/

Similar Messages

  • Xml file not generated through Pl/sql procedure as a concurrent executable

    Hi,
    I getting error while genarating xml file through Pl/sql procedure as a concurrent executable file.
    Error Message:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource

    Hi,
    Make sure the file has the XML header:
    <?xml version="1.0" encoding="UTF-8"?>
    or similar.
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • How i can load excel sheet into a table in oracle through pl/sql procedure

    Hi,
    How i can load excel sheet into a table in oracle through pl/sql procedure or a pl/sql block. Excel sheet is saved on my c or d drive on my machine. In xls format.

    Depending on how big your spreadsheet is and how frequently you want to do this you might want to contruct insert statements in excel, then run these. I have done this to load a few hundred rows for a one off test on dev.
    e.g. if you have values 1 and 'a' in you spread sheet and want to insert them in to table xxx col1 & 2:
    | /|   A   |   B   |    C
    |1 |col1   |col2   |
    |2 |      1|a      |="insert into xxx ("&$A$1&","&B1&") values ("&A2&",'"&B2&"');"then paste the contents of colum C
    insert into xxx (col1,col2) values (1,'a');into sqlplus or a script.

  • Sending an emial through PL/SQL procedure

    Hi All,
    Can any one suggest me how to send an email through PL/SQL procedure without any mail package installed in Database.
    Thanks

    Does "without any mail package" mean that you don't want to use the UTL_MAIL or UTL_SMTP packages that Oracle delivers (depending on the version of Oracle that you haven't mentioned)?
    Justin

  • Best Practice for ViewObjects when inserting data through pl/sql procedure

    My applications is oracle form based enterprise level application and we are now developing new module in ADF 11g but there is restriction that all data insertion, updation, and deletion will be through oracle pl/sql procedures. Now my question is that adf pages should be binded with ViewObjects based on Entity Object or with Viewobjects not based on Entity / sql query. Currently I have developed pages with programmatic ViewObjects which are neither based on Entity Objects nor on sql query. In those view objects, i create transient attributes and then used it to create adf pages. Then on save, i extract the data from ViewObject's current row and pass it to procedure. This is working fine but just wondering whether this approach is ok or there is better alternative for that. Ideally i want to create ViewObjects based on EntityObject but don't finding any way to synchronize entityObjects with data inserted through procedures.

    Hi,
    I create a EO for the Database-View and override the doDML()-Method. For insert/update and delete I call the pl/sql-functions.
    See "38.5 Basing an Entity Object on a PL/SQL Package API" in Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development
    Framework.

  • RMAN through PL/SQL procedure

    Hi there
    I am using oracle 10g 10.2.0.3 in AIX environment
    I want to run RMAN backup from PL/SQL procedure. Is there any provision to do that.
    Please guide me .
    Regards
    hassan

    Hemant K Chitale wrote:
    DBMS_BACKUP_RESTORE is not intended to be used for Database BACKUPS and RESTORES.
    It is to be used with Oracle Support assistance if normal RMAN commands cannot be used (e.g. the backuppiece containing a controlfile backup cannot be identified).
    I do not suggest build your backup recovery strategy using DBMS_BACKUP_RESTORE.Its just learning how to restore/recover database using this package( internally how work/do RMAN session).So if you want build your backup policy of course you have to refer first documentation (backup recovery guide).

  • Email through pl/sql procedure

    Hello,
    I want to send email from oracle database. I am running the procedure on Oracle9i on Linux (downloaded from this site).I have copied demo_mail.sql provided by Otn sample code. After running this procedure I am getting error:
    ORA-29278 SMTP Transient error: 421 service not available. can any one guide me how to avoid this error.
    Amita

    hello -
    where can I find exactly demo_mail.sql code ?
    Thanks
    Vidya R.

  • Print my input which i accept in my procedure in Excel Sheet through pl/sql

    Respected Sir,
    If i want to print my input in excel sheet which i took as a input parameter for my procedure
    for example my procedure:
    create or replace procedure create_csv('hello this is wonder world').
    I want to print hello this is wonder world in excel sheet.
    How can i acheive this through pl/sql procedure. with out utl_file predefined package.
    Please help me regarding this.
    Sincerely,
    Chandrasekhar B.S.

    maybe this link accessing oracle via access and excel might be of some help.

  • Creating PDF documents from PL/SQL

    I would like to know if there is a way to create dynamic PDF documents from PL/SQL procedures using OWA replacement cartridge?
    null

    I would like to know if there is a way to create dynamic PDF documents from PL/SQL procedures using OWA replacement cartridge?
    null

  • Loading data through pl/sql

    Hi frnds,
    i want to load .mdb table into oracle 9i through pl/sql procedure.
    i am doing this through sql* loader
    my script is :
    LOAD DATA INFILE '//empwrpub1/Data_Wrangler/Owens/Original Data/037 Refresh 10-06/SAP/SRM_INVOICE.txt'
    INTO TABLE SRM_INVOICE_200610
    FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    LINES TERMINATED BY '\n'
    IGNORE 1 LINES
    now i want this through pl/sql procedure
    thanks in advance

    Hi,
    The two different questions have arised during this Forum.
    1. Load data through SQL loader from PL/SQL.
    2. Use of many DDL and DML statements in the process of Data Loading.
    I will start from the second Question :
    this is great question I myself has faced this problem like first create temporary tables load data, update spaces with null or date formatting etc.
    This is easily achieved when you load the data by using External Tables. There you need to write a script mentioning your datafile, location, column and line termination etc. In this same script you use your DDL statements first and then data loading script and there after DML if any.
    This block would look like something PL/SQL block.
    So, First questioin has also been answered with the condition that you have to use External tables and then load data by writing PL/SQL. I am not sure as I have never tried to call SQL loader commands from PL/SQL. So it Looks impossible. If at all you want to carry out the same activity from PL/SQL block then write a SQL loader Script, CTL file and then write a SHELL Program and then call it from PL/SQL Block.
    Bye

  • How to access IFS document contents in PL/SQL procedure ?

    I am interested in using IFS as a way to load documents
    (PDF, HTML, RFT, text...) in an Oracle database table, and
    then access the table via a regular application Server.
    I understand that the right way to do this is via a Java API
    mapped on top of IFS.
    But we already have a fairly sophisticated web application using
    Java and PL/SQL procedures so that I would ideally need
    to write a PL/SQL procedure such as :
    function get_document (ifs_file_name in varchar, ifs_file_path in varchar) return clob
    For this I need to outline how to query the IFS schema using SQL.
    Any idea which table to query ?
    Have a nice day

    Many thanks to Chris Schneider : it works. Withing a few hours
    I was able to make a servlet with a file name as a parameter which sends back
    the file contents (in our case its a PDF file).
    Here is a sample servlet which uses this access scheme :
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class TestIFS extends HttpServlet
    * Handle the GET and HEAD methods by building a simple web page.
    * HEAD is just like GET, except that the server returns only the
    * headers (including content length) not the body we write.
    public void doGet (HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    //PrintWriter out;
    String title = "Test d'acchs IFS";
    // set content type and other response header fields first
    response.setContentType("application/pdf");
    // then write the data of the response
              ServletOutputStream outbin = response.getOutputStream();
              String theQuery=
         "SELECT "+
         " odm_publicobject.name object_name"+
         ", odmm_contentstore.id content_id"+
         ", odm_format.mimetype"+
         ", odmm_contentstore.globalindexedblob "+
         "FROM odm_publicobject"+
         ", odm_document"+
         ", odm_contentobject"+
         ", odmm_contentstore"+
         ", odm_format "+
         "WHERE odm_publicobject.id = odm_document.id "+
         "AND odm_document.contentobject = odm_contentobject.id "+
         "AND odm_contentobject.content = odmm_contentstore.id "+
         "AND odm_contentobject.format = odm_format.id "+
         "AND odm_publicobject.name = ";
              theQuery += "'" + request.getParameter("fic") + "'";
              try {
                   System.out.println("TestIFS debut");
                   DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
                   Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@LXP9","ifssys","ifssys");
                   Statement stmt = conn.createStatement ();
                   ResultSet rset = stmt.executeQuery (theQuery);
                   while (rset.next ()) {
                        byte b[] = new byte[10000000];               
                        b = rset.getBlob(4).getBytes (1,10000000);
                        outbin.write (b);
                   rset.close();
                   System.out.println("TestIFS fin");
              catch (Exception e) {
    (beware mime type is forced to PDF, and file size max 10Mb)

  • Disabling Secondary Popup When Accessing Office 2003 Documents Through KM

    Hi,
    we have the old problem with "Disabling Secondary Popup When Accessing Office 2003 Documents Through KM" which was topic of a weblog by John Mittendof already.
    For us it was solved when using Windows-integrated authentication without changing the registry as described.
    This works with Office2003 SP1. With SP2 the popup appears again.
    Does anyone have the same problem???
    The disadvantage with the registry solution is, that the files will be stored in the temporary internetfiles which leads to a message when opening a second time (in the sense of: document already open by "myself" - open writeprotected?).
    Best Regards
    Helge Stührmann

    Please Try this: (You should change all these settings or you'll get other errors)
    Go to Content Management ® Global Services ® URL Generator Service.
    Make the following changes:
    &#9679;      a) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs in the parameters Image Path, Viewer, XML Forms CSS URL, and Content Access Path with /irj/go/km/docs
    The entry in the Image Path parameter must look as follows: /irj/go/km/docs/etc/public/mimes/images
    &#9679;      b) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.uidetails in the parameters Resource Properties Page and New Resource Properties Page with /irj/go/km/details
    &#9679;      c) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.navigation in the parameters Explorer Servlet and Navigation Servlet with /irj/go/km/navigation
    &#9679;      d) Replace
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent in the parameters Highlighted Content with /irj/go/km/highlightedcontent
    &#9679;      e) Replace
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.basicsearch in the parameter Basic Search Servlet with /irj/go/km/basicsearch
    Regards, Fede

  • Passing arrays through multiple PL/SQL procedures and functions

    I am maintaining a large PL/SQL application. There is a main procedure that is initially called which subsequently passes information to other PL/SQL functions and procedures. In the end an error code and string is passed to PUT_LINE so it can be displayed. What I would like to be able to do is have an array that stores an error code and string for each error that it comes upon during going through each of the procedures and functions. This would involve passing these codes and strings from function to function within the pl/sql application. What would be the best way to implement this and is it possible to pass arrrays or records to other PL/SQL functions? Thanks.

    Here is one simulation ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>
    satyaki>create or replace type n_array is table of number;
      2  /
    Type created.
    Elapsed: 00:00:07.10
    satyaki>
    satyaki>CREATE OR REPLACE PROCEDURE Get_Array(array_in IN n_array,
      2                                        array_out OUT n_array)  
      3  IS
      4  BEGIN 
      5    array_out := n_array(); 
      6    FOR i IN 1..array_in.count 
      7    LOOP 
      8      array_out.extend; 
      9      array_out(i) := array_in(i) * 2; 
    10    END LOOP;
    11  END Get_Array;
    12  /
    Procedure created.
    Elapsed: 00:00:00.89
    satyaki>
    satyaki>
    satyaki>Create or Replace Procedure Set_Array(myArray IN n_array)
      2  is  
      3    i   number(10);  
      4    rec emp%rowtype;  
      5    w n_array:=n_array(1200,3200);
      6    bucket n_array := n_array();
      7  Begin
      8    Get_Array(w,bucket);  
      9   
    10    for i in 1..myArray.count  
    11    loop 
    12      select *  
    13      into rec 
    14      from emp 
    15      where empno = myArray(i); 
    16      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename);
    17      for j in 1..bucket.count
    18      loop
    19        dbms_output.put_line('Commission Sub Type: '||bucket(j));
    20      end loop;
    21    end loop; 
    22  End Set_Array;
    23  /
    Procedure created.
    Elapsed: 00:00:01.33
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
          7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       7000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
    13 rows selected.
    Elapsed: 00:00:00.28
    satyaki>
    satyaki>declare
      2    v n_array:=n_array(9999,7777);  
      3  begin  
      4    Set_Array(v);  
      5  end;
      6  /
    Employee No:9999 Name:SATYAKI
    Commission Sub Type: 2400
    Commission Sub Type: 6400
    Employee No:7777 Name:SOURAV
    Commission Sub Type: 2400
    Commission Sub Type: 6400
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.15
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Diconnection  document through dunning  procedure

    Hi  all
    Iam  trying  2 create a disconnection  document through duning  proedure,but during the FPVB step in  log  insteasd of  disconnection  document  i  get  work item  number instead.
    Also the collection startergy field in  contract account  ofor which i make  dunning  proposal  gtes itself values updates even though i  create a contract account  wothiout any calues in the master data groiuop  field and in  collection  stratergy field after  the dunning  proposal step.
    so vat seeting has to  be taken  of to  avoid this automatic updataion of the collection  startegy  in the
    contract account..
    any idea??
    kr
    rAJ

    Hello Reza,
    Only one legitimate SP for B1 user is to validate transaction for blocking.  You have to check SDK to see if that is the tool for you.
    Thanks,
    Gordon

  • How to send a java array to a pl/sql procedure

    Hi,
    This is similar to a post about 6 months ago on retrieving pl/sql tables from a java application but I can't seem to figure out how to use what I learned there to solve this.
    In a java application I have a Long[] array, and in the database I have a pl/sql procedure which takes a numeric in parameter. I currently loop through the array in my java application and call the procedure multiple times. What I'd prefer to do is to be able to pass the entire array to a new procedure which performs the looping internally.
    John
    null

    Kathy,
    Search the archives of this forum and the JDBC forum for the terms STRUCT and ARRAY and you can find some sample code on the JDBC How-To Documents page and the JDBC Samples which can both be accessed from this page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

Maybe you are looking for

  • Moving library to external hard drive and get the error "Copying files failed. The disk could not be read from or written to"

    Hello, I'm moving my library to an external hard drive. I've made sure to use the 'Keep iTunes Media Folder Organized' option when pointing to the new library location. I select 'File'->'Library'->'Organize Library', I select to 'Consolidate Files',

  • Maximum file size

    Hey! I have a simple question... I have this 2Gb text file that I wan to open and either split or extract data from and I was wondering how large of a file can I open and work with using I/O? FYI. I am trying to import this file into Excel and I wann

  • Premiere CC dual link 444 layoff drops black and luminance levels.

    Hello, we are laying off some master tapes to HDCAM SR and are encountering problems as soon as we switch to dual lin 444 lay off. We are running Premiere 7.0.1 on a macpro 8 core with osx 10.8.5 and a decklink 3D Extreme card. Everything works fine

  • So frustrated about swf movies not playing....any help?

    Seems to be I have a very familiar problem with a multitude of similar posters and online questions about why a .swf project file will properly embed and preview within Dreamweaver CS4 when previewing in browser but when loaded to my server the .swf

  • Can't send folders... could until today

    This is something new. My work partners and I all live in different areas and we have been sharing folders through iChat to transfer work files. Now comes this message I have never seen before: Your buddy cannot receive transfers of directories (fold