Storing pdf into oracle

Hello,
I have oracle 10g expree edition. I want to store pdf files in my oracle database. How can I do it using apex. I got some forums to do this but I culdn't get what blocks and web util they are talking about. Can anyone please guide me how to do it. I am new to oracle and need help.
Thanks.

Blocks and webitil has nothing to do with Apex. Go to the Apex forum.

Similar Messages

  • Storing documents into Oracle

    Hi,
    What is the apropriate field type for storing documents such as pdf and doc?
    I suppose that these formats use xml for storing data so it's possible to se CLOB?
    What do you think?
    Regards
    Peter

    Handle:      user10484841
    Status Level:      Newbie
    Registered:      Jul 12, 2010
    Total Posts:      45
    Total Questions:      24 (21 unresolved)
    so many questions & so few answers.
    What is the apropriate field type for storing documents such as pdf and doc?BLOB
    What is the apropriate field type for storing documents such as pdf and doc?CLOB for XML

  • Download pdf into browser, object not stored in wwv_flow_files

    Was wondering if you’re able to help? I want to view a pdf I’ve stored in a blob column via APEX.
    I can view pdf’s I’ve uploaded and stored via apex i.e. stored in wwv_flow_files, but not objects stored in other tables.
    To help see what I’m doing I will detail the way I can get working (Via Apex)
    Scenario via apex:
    create table demo.apex_document_upload(
    name varchar2(90),
    load_date date,
    load_user varchar2(100));
    Create upload page
    Using a HTML region
    I insert a button called upload with a branch to page of &APP_PAGE_ID.
    Create a file browse item
    Add a page process plsql to run on upload button
    begin
    insert into demo.apex_document_upload (name,load_date,load_user )
    values (:P9_FILE_NAME,sysdate, :app_user);
    end;
    Run page and upload a pdf document.
    Create PDF Apex View page
    Create a reports page using below sql code.
    select
    wff.id, lf.load_date, lf.load_user, wff.filename PDF_FILE
    from
    wwv_flow_files wff, demo.apex_document_upload lf
    where
    wff.name = lf.name;
    Edit the report attributes and go into the pdf_file link attributes:
    Set
    link text = #PDF_FILE#
    target=URL
    url=p?n=#ID#&p_inline=YES
    Run the report page click on the link and the pdf should be launched.
    Issue
    Issue I want to store the images in the user’s schema and load the images in bulk, I have over 100,000 pdfs to load and do not want to do this one at a time.
    I can load the images into Oracle OK using below:
    The issue with this is that the blob is stored in the wwv_flow_files table and you have to laod one image at a time. I’m looking at loading on 100k of images so this is not practical.
    So I was wanting to load the images via sqlldr
    create table demo.schema_document_upload
    name varchar2(100),
    file_name varchar2(100),
    file_image blob,
    load_date date)
    sqlldr controlfile
    load_bulk_pdf.ctl
    load data
    infile *
    append
    into table demo.schema_document_upload
    FIELDS TERMINATED BY ','
    Name CHAR
    , file_name CHAR
    , file_image LOBFILE(file_name)
    TERMINATED BY EOF
    NULLIF file_name='NONE'
    , load_date SYSDATE
    begindata
    image1,00000002.pdf
    image2, 00000006.pdf
    image_3,0000000A.pdf
    This loads the PDF’s into the demo.schema_document_upload table, but I’ve been unable to get APEX to open these PDF’s.
    Has anyone tried this before?

    Hello dtt676 (Tip for you, put your name in your profile) :-)
    Here's how I do it...
    1)Create a stored procedure (Standalone or as a part of a package as appropriate) like this...
      PROCEDURE get_pdf (p_pdf_id IN NUMBER) IS
        v_blob       BLOB;
        l_length     NUMBER;
        v_mime_type  VARCHAR2(30);
        v_file_name  VARCHAR2(200);
      BEGIN
        -- get pdf_data and its mime type from the database
        SELECT a.pdf
              ,a.mimetype
              ,a.filename
        INTO   v_blob
              ,v_mime_type
              ,v_file_name
        FROM   pdf_table a
        WHERE  a.pdf_id = p_pdf_id;
        l_length := dbms_lob.getlength(v_blob);
        owa_util.mime_header(v_mime_type, FALSE);
        htp.p('Content-length: ' || l_length);
        htp.p('Content-Disposition: filename="' || v_file_name || '"');
        owa_util.http_header_close;
        wpg_docload.download_file(v_blob);
        EXCEPTION
          WHEN OTHERS THEN
               RAISE_APPLICATION_ERROR(-20001, 'Error:  '                || SQLERRM
                                       ||'. p_pdf_id: '  || p_pdf_id
      END get_pdf;2) In "Shared Components", create an "Application Process" of type "On Demand" type "PL/SQL Anonymous Block" called GET_PDF with the following 'Source'
    BEGIN
      get_pdf(p_pdf_id => &P1_PDF_ID.);
    END;3) Make sure your target page for displaying your PDF has an item containing the unique ID of the stored PDF you want to display, an item containing the mimetype and an item containing the filename.
    4) create an HTML Region on the page you want to display your PDF with the following in the region source.
    <iframe src="f?p=&APP_ID.:1:&APP_SESSION.:APPLICATION_PROCESS=GET_PDF" width="800" height="1000" name="&P1_FILENAME." type="&P1_MIMETYPE."></iframe>You will need to set the page IDs to the relevant page for your application and you'll need to set the item names to those you're using in your database but, assuming you have your PDFs stored in a BLOB column, this should do the trick.
    Please feel free to come back to me if you have any questions.
    Kind regards
    Simon Gadd

  • Storing PDF file into DB & restoring back to Filesystem

    Hi Everybody,
    I need to store PDF files into Database (Oracle 8.1.6 on Windows NT). This I could do using DBMS_LOB Package. Now, my problem is bringing back the PDF files to OS filesystem.
    I feel my problem will be solved if I have UTL_LOB Package Object in my Database. Where can I get the script or utility that installs the said Object in my Database. Kindly send me the script/utility if anybody has.
    Thanks & Regards,
    Durai.

    look,
    http://stackoverflow.com/questions/2347842/storing-pdf-files-as-binary-objects-in-sql-server-yes-or-no
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • Saving a PDF or DOC file into Oracle 9i using Developer Forms 10g

    Hi guys,
    I want to save a pdf or doc file into oracle 9i. I am using Developer 10 g. Please help me;
    1. What datatype field should be in database table to store such file.
    2. Which code should I use in Forms 10g to display open file dialog, get the name and save that into database table.
    Thanks in advance

    WEBUTIL is a library used with forms to interact with the client. With Forms10G the library comes shipped with the developer suite, for forms 9i i'm not sure, check the forms-page at otn if there is any download available. For documentation about how to do a file-upload, simply search the forum, there are lots of examples.

  • Pdf is stored in a oracle table

    hi
    I have stored pdf files in oracle table , how do we get this and store as a .pdf file .How to find pdf files please help me.

    This is indeed helpful as an example, but what I tried to show in my example is that the content of the field that I am trying to print is html--many times a table--but I do not know what the contents are, (and perhaps I do not know xsl well enough), I can't take the example here and apply a table to the xsl file. Still looking...

  • Extracting Tiff files stored into Oracle 8.1.7 as Long Raw

    I have around 1 million tiff images stored into Oracle 8.1.7. The field type is Long Raw. The frontend used to store images into the database is SQL Windows 5 from Gupta Corporation, now called Centura. I guess the images are stored in binary format in the database. I need to extract these images at the OS level. Each Rec_no contains one tiff file in database. The table structure is as follows:
    Rec_no Number(8)
    image Long Raw
    My goal is to convert these tiff files to JPG files so that my web application written in ASP.Net can use them and show in IE. The files are required to be converted to jpg as IE does not have native support for showing the tiff files(I hope I am not wrong in this assumption). Can i convert these tiffs to jpg directly inside the oracle database??? or i need to extract them first, save at OS level, convert them and then write back to the database?? Pls give code examples if possible. I plan to migrate the database also from 8i to 10g shortly and this is one of the migration taks. Thanks in advance...
    Ravinder Hooda

    I have around 1 million tiff images stored into Oracle 8.1.7. The field type is Long Raw. The frontend used to store images into the database is SQL Windows 5 from Gupta Corporation, now called Centura. I guess the images are stored in binary format in the database. I need to extract these images at the OS level. Each Rec_no contains one tiff file in database. The table structure is as follows:
    Rec_no Number(8)
    image Long Raw
    My goal is to convert these tiff files to JPG files so that my web application written in ASP.Net can use them and show in IE. The files are required to be converted to jpg as IE does not have native support for showing the tiff files(I hope I am not wrong in this assumption). Can i convert these tiffs to jpg directly inside the oracle database??? or i need to extract them first, save at OS level, convert them and then write back to the database?? Pls give code examples if possible. I plan to migrate the database also from 8i to 10g shortly and this is one of the migration taks. Thanks in advance...
    Ravinder Hooda

  • An introduction into Oracle XMLDB 11gR1 (pdf - 4 Mb)

    For a Dutch DBA Conference next week on which I will present some XMLDB topics, I created a small goody / whitepaper with XMLDB DBA / Concepts content.
    For those who are interested, have a look here:
    - An introduction into Oracle XMLDB 11gR1 (pdf - 4 Mb):
    http://www.liberidu.com/blog/images/Marco%20Gralike%20-%20An%20introduction%20into%20Oracle%20XMLDB%2011gR1.pdf
    Content:
    - XML(DB) Concepts
    - XML Storage
    - XMLIndex
    - Security
    - The Protocol Listener
    - APEX

    What error? Please be exact.

  • Storing JSON string into Oracle table

    Hi,
    What is appropriate way to store JSON string into Oracle table?
    Regards
    Peter

    If JSON becomes more popular, ORACLE might write data cartridge extension for JSONDB (in the same way as XMLDB).
    Till then CLOB and NCLOB is your best choice, and leave the parsing in your application layer.

  • I am trying to import BPM Project.zip file into Oracle enterpriserepository

    I am trying to import BPM Project.zip file into Oracle enterpriserepository from admin tab.
    I am getting the following exception. please help if any one know the solution.
    Performing import...
    Import Failed: Error [100]: An unknown server-side error occurred. Please record stack trace (if available) and contact technical support.
    com.flashline.exception.LoggableException: trouble parsing file in import bundle: SampleWScall/activityGuide.agdl
         at com.flashline.cmee.openapi.service.subsystem.impexp.XMLTranslator.decode(XMLTranslator.java:157)
         at com.flashline.cmee.openapi.service.subsystem.impexp.ImportJob.doJob(ImportJob.java:74)
         at com.flashline.cmee.openapi.service.subsystem.impexp.AbstractJob.perform(AbstractJob.java:75)
         at com.flashline.cmee.openapi.service.subsystem.impexp.JobThread.run(JobThread.java:41)
    Audit results stored in:
    C:\Users\AVINAS~1.YEL\AppData\Local\Temp\import-4705112223687937017.log
    Audit for [Import job.] created on [2012-09-24 11:53:59 IST].
    2012-09-24 11:53:59 IST - Adding Import job with ID=[50403] to job queue.
    Thanks in Advance.

    Hi
    Why are you trying to import BPM zip file are you trying to configure the out of the box workflows?
    They are something that need to be deployed from the process admin on BPM.
    There would be the .exp file you would need as its BPM 10g that you would need to use.

  • SQLException while calling a Stored Procedure in Oracle

    Hi all,
    I am getting this error while calling a Stored Procedure in Oracle...
    java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
    at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
    at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
    The Program is ...
    import java.sql.*;
    public class StoredProcedureDemo {
         public static void main(String[] args) throws Exception {
              Connection con = null;
              ResultSet rs = null;
              Statement st = null;
              CallableStatement cs = null;
              int i;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
                   System.out.println("Got Connection ");
                   st = con.createStatement();
                   String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
                             +" Emp_name VARCHAR2(10);"
                             +" CURSOR c1 (Depno NUMBER) IS"
                             +" SELECT Ename FROM emp WHERE deptno = Depno;"
                             +" BEGIN"
                             +" OPEN c1(Dept_num);"
                             +" LOOP"
                             +" FETCH c1 INTO Emp_name;"
                             +" EXIT WHEN C1%NOTFOUND;"
                             +" END LOOP;"
                             +" CLOSE c1;"
                             +" END;";
                   System.out.println("Stored Procedure is \n"+createProcedure);
                   i = st.executeUpdate(createProcedure);
                   System.out.println("After creating the Stored Procedure "+i);
                   cs = con.prepareCall("{call Get_emp_names(?)}");
                   System.out.println("After calling the Stored Procedure ");
                   cs.setInt(1,20);
                   System.out.println("Before executing the Stored Procedure ");
                   rs = cs.executeQuery();
                   System.out.println("The Enames of the given Dept are ....");
                   while(rs.next()) {
                        System.out.println("In The while loop ");
                        System.out.println(rs.getString(1));
              catch (Exception e) {
                   e.printStackTrace();
    Stored Procedure is ...
    create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
    Emp_name VARCHAR2(10);
    CURSOR c1 (Depno NUMBER) IS
    SELECT Ename FROM emp WHERE deptno = Depno;
    BEGIN
    OPEN c1(Dept_num);
    LOOP
    FETCH c1 INTO Emp_name;
    EXIT WHEN C1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;
    Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
    thanks and regards
    Shyam Krishna

    The first solution is to not do that in java in the first place.
    DDL should be in script files which are applied to oracle outside of java.
    Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation.

  • Error while Uploading PO's into Oracle

    I tried 2 different ways of uploading PO into Oracle
    SOA Suuite 11.1.1.3.0
    JDev : 11.1.1.3.0
    Oracle EBS 11.5.10.2
    1. Calling the Stored procedure which has fnd_request.submit_request
    2. Using Oracle Applications Adapter and calling the standard concurrent program
    When I do step 1 I was able to create PO in every alternate session. it gives the following error for every other instance. But this error comes only every alternate time.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'RF_POImport' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the APPS.RFCUST_PKG_PO_IMPORT.RFCUST_PO_IMPORT_PROC API. An error occurred while preparing and executing the APPS.RFCUST_PKG_PO_IMPORT.RFCUST_PO_IMPORT_PROC API. Cause: java.sql.SQLException: ORA-20001: Oracle error -20001: ORA-20001: Oracle error -2074: ORA-02074: cannot SET NLS in a distributed transaction has been detected in fnd_global.set_nls.set_parameter('NLS_LANGUAGE','AMERICAN'). has been detected in fnd_global.set_nls. ORA-06512: at "APPS.APP_EXCEPTION", line 72 ORA-06512: at "APPS.FND_GLOBAL", line 245 ORA-06512: at "APPS.FND_GLOBAL", line 1426 ORA-06512: at "APPS.FND_GLOBAL", line 1684 ORA-06512: at "APPS.FND_GLOBAL", line 2309 ORA-06512: at "APPS.FND_GLOBAL", line 2447 ORA-06512: at "APPS.FND_GLOBAL", line 2385 ORA-06512: at "APPS.RFCUST_PKG_PO_IMPORT", line 1096 ORA-06512: at line 1 ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
    </part>
    <part name="detail">
    <detail>ORA-20001: Oracle error -20001: ORA-20001: Oracle error -2074: ORA-02074: cannot SET NLS in a distributed transaction has been detected in fnd_global.set_nls.set_parameter('NLS_LANGUAGE','AMERICAN'). has been detected in fnd_global.set_nls. ORA-06512: at "APPS.APP_EXCEPTION", line 72 ORA-06512: at "APPS.FND_GLOBAL", line 245 ORA-06512: at "APPS.FND_GLOBAL", line 1426 ORA-06512: at "APPS.FND_GLOBAL", line 1684 ORA-06512: at "APPS.FND_GLOBAL", line 2309 ORA-06512: at "APPS.FND_GLOBAL", line 2447 ORA-06512: at "APPS.FND_GLOBAL", line 2385 ORA-06512: at "APPS.RFCUST_PKG_PO_IMPORT", line 1096 ORA-06512: at line 1 </detail>
    I tried the Oracle Applications adapter...I'm getting the following error. But If i set the org,user and application in FND_GLOBAL for the first time and call the apps adapter its working fine for some time. I guess some caching issue with DB and apps adapter was not able to set the org,resp and user
    Encountered an error while getting the ORACLE user account for your concurrent request. Contact your system administrator
    Please Advice.
    Thanks In Advance,
    Satish

    Hi,
    I faced this issue and was able to resolve by doing the following.
    1. For Oracle Apps adapter, set the NLS Lang, Org Id, Username, Responsibility, Application details.
    2. Instead of using an XA transaction data source, create a non-XA data source connection and use it in the Apps adapter JNDI.
    This should resolve your issue.
    Thanks,
    Gautham

  • To store PDF into BLOB and retrieve into OLE/OCX

    We would like to:
    1. Store a PDF file (output of a report saved in file server) into a BLOB
    column.
    2. Retrieve previously stored PDF in the BLOB column and display using either
    OLE automation or ActiveX (OCX) control.
    I read all related documents in metalink that addresses this issue however cant
    get this to work. We have Acrobat Reader 4.0. Here are some issues from the
    tests that I did:
    1. To load the PDF file the program code that uses BFILE and LOADFROMFILE does
    not work since the database is on a remote server and the PDF file is on a
    local file server. The DIRECTORY created on the database is unable to find the
    PDF file.
    2. Though I want the loading of the file to be programmatic, I tried
    right-click on the OLE container and inserted object from file. This loaded the
    file into the container (Icon on the container appeared) however I was not able
    to view the document by double-clicking. An error in Adobe occured: 'There was
    an error opening this document. A file read error occured'. My guess is the
    'Insert Object' did not insert the file properly into the BLOB.
    3. When trying to display the PDF file stored in file server (in case storing
    into BLOB does not work), I used an OCX control, right-clicked and Insert
    Object and select Adobe Control for ActiveX. The problem here is when I run the
    form, the OCX control shows up empty and I have to 'Insert Object' again in
    runtime. Once I manually insert object from runtime the GET_INTERFACE POINTER &
    SET_PROPERTY works fine is displaying the document. Is there any way to
    maintain the control property of the OCX when the form is run?
    4. Are there any workarounds and better solution to store PDFs into BLOBs and
    retrieve and display in OLE/OCX controls? Using temporary file into local drive
    is not an issue.
    5. Would I be able to make use of 'PDF.PdfCtrl.1' OLE class?
    6. Does OLE automation work for Acrobat Reader 4.0.?
    I would appreciate all the help.
    Shyam

    Im facing a similar kind of problem. I want to store and retrieve Office files, PDF and Jpegs into/from the database to view them on web in disconnected mode. Please reply as I cant find any help/documentation regarding saving BLOB data into files. I was able to store file data into BLOB, using DBMS_LOB package.
    Shahzad

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Extract the data from SQL Server and Import into Oracle

    Hi,
    I would like to run a daily job that will export the table data from SQL server table (it will be only one or two table) and Import back into Oracle table (it might one or two table tables).
    Could you please guide me that how can i do this using either sql server or oracle?
    We have oracle 9.2 and sql server 2005.
    Normally i do from flat file which is generated by source destination nand i dump into oracle using sql*loader but this time I have to directly extract/export the data from MS Sql server and load into Oracle table, mostly it will reload so i might doing any massaging data during the load.
    If you show me the detail approach, it will be really appreciated.
    I have access to Sql server but i don't how to use sql server to do this or using oracle as a daily job even becuase have to schedule the job for this as it will be a daily job.
    Thanks,
    poratips

    Unless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
    As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
    Justin

Maybe you are looking for