Create a file and store it in the database using UTL_FILE package

Hello.
I'm using UTL_FILE package to store data from a table into an excel file but I don't know how to store this file in a table with a BLOB field the database at the same time. I want do do this because I will use it in a Oracle Portal.
Anybody has any idea how to do this?
Thanks & Regards,
Alexandra

From Asktom
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:232814159006

Similar Messages

  • Reading the contents of a folder and store them in the database using 6i

    Hi all,
    I'm using developer 6i and oracle 8i,now am building personnel database,every employee has many certificates (graduate certificates,post-graduate certificates and work experience certificates),I want to scan all these certificates,put them in a folder ,give the form (employee form ) the path to the folder and the form read the contents of the folder (3 or 4 image files for example) dynamically and store them in the database.
    All examples I came across explain how to load a defined image file name into oracle database,but what if the image file name is not defined (i,e dynamically generated by the scanner).
    Hope I explained the case.
    Thanks in advance

    Sorry mhdamer,
    I read the example and thought it could be modified to retreive a directory listing. There is a way to do what you want, but you will have to check to see if you have the D2kwutil.pll installed with Forms 6i. If you do not have it installed you can download the pll from OTN. This Forms Library will only work on Windows, so if you want this functionality on a non-windows machine, it will not work. Read the D2KWUTIL.html for details on how to use this library. There are also some good posts here in the forums on how to use this library. Just search on D2KWUTIL.PLL.
    Craig...

  • Reading the datas in the Xml file  and store it in the array using java

    Hi every one
    Can any one send me the java coding for traversing through XML file and get the data and store it in the array (SAX parser is prefered)
    its a urgent requirement . please help me
    Regards
    Arun

    i send it to ur mail id ,
    could you please send me a mail to [email protected]

  • How to create a file and store its contents into another file?

    Hi,
    I'm having some trouble trying to create a code where I have to to create a file and store its contents into another file?
    I read the API, but I'm not certain how this file thing works.
    Here's my code so far:
    public static void main(String[] args) throws Exception
              File file = new File("tasks.txt");
              if (file.exists())
                   System.out.println("File already exists");
                   System.exit(0);
              Scanner scan = new Scanner(System.in);
              Scanner scan2 = new Scanner(System.in);
              //Scans the input line by line
              scan.useDelimiter("\\n");
              //Scans the input by tabs
              scan2.useDelimiter("\\t");
              PrintWriter outputs = new PrintWriter("newtasks.txt");
              outputs.print("ok");
              outputs.println(3);
              outputs.close();
         }

    I managed to change my text into uppercase, but how do I store the uppercase content into another file.
    -So this is what I did so far, I took a text file and modified its strings to uppercase.
    -Now I need to put those modified strings into another text file, is there a way where I can do that with my current code?
    -I already tried printwriter, but it doesn't seem to work
    public static void main(String[] args)throws IOException
              //Task[] oneHundredTasks = new Task[100];
              String uppercase;
              String combine;
              Scanner scan = null;
              FileInputStream in = null;
            FileOutputStream out = null;
            PrintWriter output = null;
            try
                 scan = new Scanner(new BufferedReader(new FileReader("tasks.txt")));
                 scan.useDelimiter("\\n");
                 scan.useDelimiter("\\t");
                while (scan.hasNext())
                     if(!scan.hasNext())
                          scan.next();
                     combine = scan.next();
                     uppercase = combine.toUpperCase();
                     System.out.println(uppercase);
            finally
                if (scan != null)
                    scan.close();
            //The program will try the input and output files
            try
                 in = new FileInputStream("tasks.txt");
                out = new FileOutputStream("newtasks.txt");
                int c;
                //The number "-1" is used to indicate that it has reached the end of the stream.
                while ((c = in.read()) != -1)
                    out.write(c);
            finally
                if (in != null)
                    in.close();
                if (out != null)
                    out.close();
         }

  • How to read  *.pdf files and store them in a database?

    Dear programmers,
    I have problem with reading *.pdf files and store them in a database.
    can any one help me, please!
    Is it possible to read more than one file from the local system and store them in a database.
    thnaks in advance.
    bye

    What "problem" are you encountering?
    Depending on your choice of database software, it may or may not support the storage of binary large objects (BLOBs).

  • Upon launch of Lightroom after initial instalation a warning came up that said lightroom needs to create temporary files and cant open.  The it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64

    Upon launch of Lightroom after initial installation a warning came up that said lightroom needs to create temporary files and cant open.  Then it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64 bit.  I have avast virus software.

    Upon launch of Lightroom after initial installation a warning came up that said lightroom needs to create temporary files and cant open.  Then it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64 bit.  I have avast virus software.

  • Unable to write files in different m/c in LAN using utl_file package

    I need to dump some files generated by utl_file package in a separate m/c not in the db server.For that I tried using utl_file_dir='*' and mapped the specified directory in the db server. but its failing as show below..
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 449
    ORA-29283: invalid file operation
    ORA-06512: at "ANIRBAN.WRITE_IN_FILE", line 9
    ORA-06512: at line 1
    The prototype sp is given below..
    CREATE OR REPLACE PROCEDURE write_in_file(pInDir IN VARCHAR2,
    pInFileName IN VARCHAR2,
    pInFileContent IN VARCHAR2) IS
    vFile UTL_FILE.FILE_TYPE;
    vFileName VARCHAR2(20) := pInFileName;
    BEGIN
    dbms_output.enable(1000000);
    vFile := UTL_FILE.FOPEN(pInDir, vFileName, 'w', 32000);
    UTL_FILE.PUT_LINE(vFile, pInFileContent);
    UTL_FILE.FCLOSE(vFile);
    END write_in_file;
    With this sp i'm able to write in genuine drives but not in mapped one.What shall be done to be able to write in a separate m/c freely.Plz guide me

    And make sure you specify the full path name of the server/directory path rather than using substituted drive names as is can sometimes be funny about that sort of thing.

  • Need the pdf file to be stored directly in database using jasper

    I am using jasper integration package ..from www.opal-consulting.de
    using apex 4 and i Am currently able to generate pdf invoice..using jasper and store in a database.. table.
    I need to generate the pdf  invoice in the background ..without dispalying in my screen..
    Without downloading on my machine..And  store directly into  the database table..
    Is it  possible..
    Any information is highly appreicated..
    Below is my existing part of code..Kindly guide.
    DECLARE
    l_blob BLOB;
    l_mime_type VARCHAR2 (100);
    l_blob2 BLOB;
    l_mime_type2 VARCHAR2 (100);
    mport varchar2(200);
    mrserver varchar2(20);
    BEGIN
    warn('fsubdno'||:P103_SUBSCRIBERDNO);
    commit;
    mrserver := rserver();
    mport := 'http://'||mrserver||'/JasperReportsIntegration/report';
    -- generate the report and return in BLOB
    xlib_jasperreports.set_report_url (mport);
    warn('firststrikeeee');
    xlib_jasperreports.get_report
    (p_rep_name => 'reinvx',
    p_rep_format => 'pdf',
    p_data_source => 'chess',
    p_rep_locale => 'de_DE',
    p_rep_encoding => 'UTF-8',
    p_additional_params => '&Psubscribe_no='||:P103_SUBSCRIBER_NO||'&Psubscribed_no='||:P103_SUBSCRIBERDNO,
    p_out_blob => l_blob,
    p_out_mime_type => l_mime_type
    WPG_DOCLOAD.download_file (l_blob);
    warn('secondstrikeee');
    WPG_DOCLOAD.download_file (l_blob);
    BLOB_LOADB (mid(),:p103_subscriber_no,null,'renewal_invoice','renewalinv'||:p103_subscriber_no,l_mime_type,l_blob);
    -- release resources
    DBMS_LOB.freetemporary (l_blob);
    -- stop rendering of APEX page
    apex_application.g_unrecoverable_error := TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN
    xlog ('PRC_GET_REPORT_TUNNEL', SQLERRM, 'ERROR');
    RAISE;
    END;
    Edited by: susf on Jul 16, 2012 8:47 AM

    Hi,
    try make a procedure from your original code like this:
    procedure make_pdf(p_subscriber_no in number, p_subscriberdno in number)
    is
       l_blob blob;
       l_mime_type varchar2 (100);
       l_blob2 blob;
       l_mime_type2 varchar2 (100);
       mport varchar2(200);
       mrserver varchar2(20);
    begin
       warn('fsubdno'||p_subscriberdno);
       commit;
       mrserver := rserver();
       mport := 'http://'||mrserver||'/jasperreportsintegration/report';
       -- generate the report and return in blob
       xlib_jasperreports.set_report_url (mport);
       warn('firststrikeeee');
       xlib_jasperreports.get_report
          (p_rep_name => 'reinvx',
          p_rep_format => 'pdf',
          p_data_source => 'chess',
          p_rep_locale => 'de_de',
          p_rep_encoding => 'utf-8',
          p_additional_params => '&Psubscribe_no='||p_subscriber_no||'&Psubscribed_no='||p_subscriberdno,
          p_out_blob => l_blob,
          p_out_mime_type => l_mime_type
       blob_loadb (mid(),p_subscriber_no,null,'renewal_invoice','renewalinv'||p_subscriber_no,l_mime_type,l_blob);
       -- release resources
       dbms_lob.freetemporary (l_blob);
    exception
       when others
       then
          xlog ('prc_get_report_tunnel', sqlerrm, 'error');
          raise;
    end;Then you can call this procedure in a database job that you create with an apex process like this:
    begin
      dbms_scheduler.create_job (
        job_name        => 'make_pdf_job',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'begin make_pdf(' || :P103_SUBSCRIBER_NO || ',' || :P103_SUBSCRIBERDNO|| ') end;',
        start_date      => systimestamp,
        repeat_interval => null,
        end_date        => null,
        enabled         => true,
        comments        => 'Make pdf job from Apex page 103.');
    end;regards,
    Erik-jan

  • Why read d'information into the card and send these to the database

    hi hello world,
    i have an application where i must take some informations to the customer in their electronic card and send this informations to the database. so, in want : 1. buy the card reader which i dont know where i can buy this, 2. i must buy the card which will contain the customer informations, and 3. how put (read) informations contain into the card to my card reder and send those informations to the database.
    if some body know how i can do, please help me.
    my direct email: [email protected]

    I've changed my original question on the first thread.
    The file, glass.txt, contains the following:
    Moretti 247 H 1.1 $38.50
    Moretti 276 O 0.9 $10.80
    Vetrofond 902 T 0.4 $4.00
    Vetrofond 408 S 0.6 $9.00
    Lauscha 045 T 0.2 $2.00
    Vetrofond 907 L 0.1 $4.50
    Ex. Moretti -> manufacture name
    247 -> number
    H -> category
    1.1 -> amount of glass in pounds
    $38.50 -> cost of the glass manufacture
    "Read in each line of data from the file, and display it to the user using an information-type message box, indicating the manufacture name, the number, the category (spelled out as a word), the amount of glass in pounds, and the cost of the glass".
    I did it, but it seems that I did something wrong. Could you please help me?
    I appreciate your help. Thank you.
    import javax.swing.JOptionPane;        // Needed for the JOptionPane class
    import java.io.*;                    // Needed for file classes
    public class problem3
        public static void main(String[] args) throws IOException
            String filename;        // Needed to read the file
            String categories;        // Needed to read the categories
            // Get the filename.
            filename = JOptionPane.showInputDialog("Enter the filname.");
            // Open the file.
            FileReader freader = new FileReader(filename);
            BufferedReader inputFile = new BufferedReader(freader);
            // Read the categories from the file.
            categories = inputFile.readLine();
            // If a category was read, display it and
            // read the remaining categories.
            while (categories != null)
                // Display the last category read.
                JOptionPane.showMessageDialog(null, categories);
                // Read the next category.
                categories = inputFile.readLine();
            // Close the file.
            inputFile.close();
    }

  • Store and Display doc/pdf files in the database using Forms

    Hi all,
    How can i store and display doc/pdf files in the database using Forms 10g?.
    Arif

    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
      and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
      [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
         cd [JacobStage]
         copy jacob.jar [OraHome]\forms\java\.
         copy jacob.dll [OraHome]\forms\webutil\.
      The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
      Open a DOS command prompt.
      Add [OraHome]\jdk\bin to the PATH:
         set PATH=[OraHome]\jdk\bin;%PATH%
      Sign the files, and check the output for success:
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
      you may skip this step. Otherwise,
      Create a schema to hold the WebUtil stored code, and privileges needed to
      connect and create a stored package. Schema name "WEBUTIL" is recommended
      for no reason other than consistency over the user base.
      Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
      out the EXIT statement, to be able to see whether the objects were created witout
      errors.
      Start SQL*Plus as SYSTEM, and issue:
         CREATE USER webutil IDENTIFIED BY [password]
         DEFAULT TABLESPACE users
         TEMPORARY TABLESPACE temp;
         GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
         CONNECT webutil/[password]@[connectstring]
         @[OraHome]\forms\create_webutil_db.sql
         -- Inspect SQL*Plus output for errors, and then
         CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
      Reconnect as SYSTEM, and issue:
         grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
      to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
      Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
      It is important to generate the PLX, to avoid the FRM-40039 discussed in
      Note 303682.1
      If the PLX is not generated, the Webutil.pll library would have to be attached with
      full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
      Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
      There is no need to Subclass the WebutilConfig object.
      Attach the Webutil.pll Library, and remove the path.
      Add an ON-LOGON trigger with the code
             NULL;
      to avoid having to connect to an RDBMS (optional).
      Create a new button on a new canvas, with the code
             show_webutil_information (TRUE);
      in a WHEN-BUTTON-PRESSED trigger.
      Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
      the "Application Server URL" is empty.
      Then append "?config=webutil" at the end, so you end up with a URL of the form
          http://server:port/forms/frmservlet?config=webutil
    10) Run your form.sarah

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How can i setup pages to automatically open when double clicked.  Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Hi Karen,
    Sounds like OS X has lost the association between Pages and its files.
    Start by quitting Pages, then going to Finder.
    In Finder, locate a .pages file. Click on it (once), then press command-I (eye, not one) to Get Info.
    In the Info window that opens, expand the Open With section.
    In this section, click on the pop-up menu and choose Pages (even if Pages is already shown).
    Click the Change All button to associate all files with the .pages extension with Pages.
    Close the info window.
    Double click any .pages file to check that Pages will now launch and open the file.
    Regards,
    Barry

  • Before this last upgrade, when I would create a file and do a "Save As" it would always open "My Documents" by default, which is what I prefer. But since the upgrade it opens in some annonomus file, to which I have to go through several steps to get to My

    Before this last upgrade, when I would create a file and do a "Save As" it would always open "My Documents" by default, which is what I prefer. But since the upgrade it opens in some anonymous file, to which I have to go through several steps to get to My Documents, and I can't seem to select the default in my preferences. HELP PLEASE!!!

    Before this update of what software from what version to what version using which OS?

  • I have a family video DVD that was originally on tape, but is now on disc. I want to import it onto my MacBook to edit and store. However the files are IFO, BUP and VOB and the Mac is saying 'unable to import' as it doesn't recognise the file. Help !!

    I have a family video DVD that was originally on tape, but is now on disc. I want to import it onto my MacBook to edit and store. However the files are IFO, BUP and VOB and the Mac is saying 'unable to import' as it doesn't recognise the file. Help please !!!!!

    Those are the constituent parts of a standard mpeg2 DVD. Storing them is easy: just copy the folder to your hard drive and they will play in DVD player or VLC.
    But that format is not intended for editing. To do so:
    You need to convert the VOB files in the TS-Folder of the DVD back to DV which iMovie is designed to handle. For that you need mpegStreamclip:
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    which is free, but you must also have the  Apple mpeg2 plugin :
    http://store.apple.com/us/product/D2187Z/A/quicktime-mpeg-2-playback-component-f or-mac-os-x
    (unless you are running Lion in which case see below))
    which is a mere $20.
    Another possibility is to use DVDxDV:
    http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.overview.htm
    which costs $25.
    For the benefit of others who may read this thread:
    Obviously the foregoing only applies to DVDs you have made yourself, or other home-made DVDs that have been given to you. It will NOT work on copy-protected commercial DVDs, which in any case would be illegal.
    And from the TOU of these forums:
    Keep within the Law
    No material may be submitted that is intended to promote or commit an illegal act.
    Do not submit software or descriptions of processes that break or otherwise ‘work around’ digital rights management software or hardware. This includes conversations about ‘ripping’ DVDs or working around FairPlay software used on the iTunes Store.
    If you are running Lion:
    From the MPEG Streamclip homepage
    The installer of the MPEG-2 Playback Component may refuse to install the component in Lion. Apple states the component is unnecessary in Lion onwards, however MPEG Streamclip still needs it. See this:
    http://support.apple.com/kb/HT3381
    To install the component in Lion, please download MPEG Streamclip 1.9.3b7 beta above; inside the disk image you will find the Utility MPEG2 Component Lion: use it to install the MPEG-2 Playback Component in Lion. The original installer's disk image (QuickTimeMPEG2.dmg) is required.
    The current versions of MPEG Streamclip cannot take advantage of the built-in MPEG-2 functionality of Lion. For MPEG-2 files you still need to install the QuickTime MPEG-2 Playback Component, which is not preinstalled in Lion. You don't have to install QuickTime 7.

  • Parse files and store to "timeseries" for ouput to jpg/png?

    Hi.
    I am trying to parse through some dirs for known files and store the content + name of dir in a "timeseries" (the contents are csv and name of dir is string - hence "timeseries"), for later output to PNG.
    The file structure will be:
    dir1/filename.csv (together with other files)
    dir2/filename.csv (together with other files)
    dir3/filename.csv (together with other files)
    My idea so far is:
    public main {
       JFreeChart ... createChart(createDataset);
    private static createDataset {
        traverse("my dirs and files");
        TimeSeries series1 = new TimeSeries(name of dir1, data from file1);
        TimeSeries series2 = new TimeSeries(name of dir2, data from file2);
         etc....
    private static createChart {
    private static traverse(File dir) {
         this method scans the dirs;
         if file = "filename.csv" readFile();
    private static readFile(file, path) {
         read the data;
    }I have come to a stop, because my method/idea would only return timeseries for the first dir/file over and over again.
    Maybe I'm doing this awkwardly, but I'm very fresh at java.
    Any inspiration would be appreciated.
    Cheers,
    Chotor

    Thanks for answering.
    Maybe I should clearify a bit.
    I am already able to read csv files (thanks to opencsv). I can also travese directories looking for the correct file. I can even output timeseries to png thanks to JFreeChart.
    The problem is stiching it all togheter, and more precisely passing data between methods.
    When creating timeseries within my ceateDataset method, I am calling traverse, which then calls readData. I want these two (dir-name from traverse() and actual data from readData()) to be read into a new timeseries.
    Maybe this could be solved differently...
    We haven't covered this topic in my course yet. I'm fresh but eager. :)

Maybe you are looking for

  • In SOP- transfer forecasted values from material master to info structure?

    Hi All, I wanted to test out a few scenarios. Do you know the answers  / can you help simulate and check the below? 1.     If I run the forecast using different models for different materials using the total forecast run (MP38), the forecast values w

  • Custom miro problem

    Hi, Dear i have create import purchase order and my net price 0.01 with 1 quantity after save. when we create custom miro custom condition not pick.

  • EventOpen action play results in error when adding scripting parameters

    Hi all, I have a setup that involves two plugins: A file format plugin which I've made scripting-aware and takes one parameter and, An automation plugin that opens a number of files of this format and which passes the parameter to the first plugin. F

  • How much performance is impacted if the Stored outline is used globally?

    Hi, One of the queries that we are having problem with and we are trying to use the Stored outline so that we freeze the execution plan. The vendor is telling us that it should set globally (ALTER SYSTEM not SESSION) , but we disagreed because this w

  • Switch protection to Secondary DPM if Primary DPM fails

    Hello,       I have one Primary DPM 2012 R2 server and one Secondary DPM 2012 R2 server.  I have not found a step by step guide to switch protection over to the Secondary DPM in an event when the Primary Server is not available (gone belly up).  Look