How to store the zip file in oracle table?

hi,
How to store the zip file in oracle table ?
is it possible to unzip and read the file ?
Thanks
Rangan S

SQL> DESC BLOB_TABLE;
Name Type Nullable Default Comments
A INTEGER Y
B BLOB Y
SQL> INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'));
INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'))
ORA-00904: "BLOB": invalid identifier
SQL> INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'));
INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'))
ORA-00907: missing right parenthesis
SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));
INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'))
ORA-01465: invalid hex number
SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));

Similar Messages

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • "how to load a text file to oracle table"

    hi to all
    can anybody help me "how to load a text file to oracle table", this is first time i am doing, plz give me steps.
    Regards
    MKhaleel

    Usage: SQLLOAD keyword=value [,keyword=value,...]
    Valid Keywords:
    userid -- ORACLE username/password
    control -- Control file name
    log -- Log file name
    bad -- Bad file name
    data -- Data file name
    discard -- Discard file name
    discardmax -- Number of discards to allow (Default all)
    skip -- Number of logical records to skip (Default 0)
    load -- Number of logical records to load (Default all)
    errors -- Number of errors to allow (Default 50)
    rows -- Number of rows in conventional path bind array or between direct path data saves (Default: Conventional path 64, Direct path all)
    bindsize -- Size of conventional path bind array in bytes (Default 256000)
    silent -- Suppress messages during run (header, feedback, errors, discards, partitions)
    direct -- use direct path (Default FALSE)
    parfile -- parameter file: name of file that contains parameter specifications
    parallel -- do parallel load (Default FALSE)
    file -- File to allocate extents from
    skip_unusable_indexes -- disallow/allow unusable indexes or index partitions (Default FALSE)
    skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable (Default FALSE)
    commit_discontinued -- commit loaded rows when load is discontinued (Default FALSE)
    readsize -- Size of Read buffer (Default 1048576)
    external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE
    (Default NOT_USED)
    columnarrayrows -- Number of rows for direct path column array (Default 5000)
    streamsize -- Size of direct path stream buffer in bytes (Default 256000)
    multithreading -- use multithreading in direct path
    resumable -- enable or disable resumable for current session (Default FALSE)
    resumable_name -- text string to help identify resumable statement
    resumable_timeout -- wait time (in seconds) for RESUMABLE (Default 7200)
    PLEASE NOTE: Command-line parameters may be specified either by position or by keywords. An example of the former case is 'sqlldr scott/tiger foo'; an example of the latter is 'sqlldr control=foo userid=scott/tiger'. One may specify parameters by position before but not after parameters specified by keywords. For example, 'sqlldr scott/tiger control=foo logfile=log' is allowed, but 'sqlldr scott/tiger control=foo log' is not, even though the position of the parameter 'log' is correct.
    SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\PFS2004.CTL LOG=D:\PFS2004.LOG BAD=D:\PFS2004.BAD DATA=D:\PFS2004.CSV
    SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\CLAB2004.CTL LOG=D:\CLAB2004.LOG BAD=D:\CLAB2004.BAD DATA=D:\CLAB2004.CSV
    SQLLDR USERID=GROWSTAR/[email protected] CONTROL=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.CTL LOG=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.LOG BAD=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.BAD DATA=D:\GROW\DEACTIVATESTAFF\DEACTIVATESTAFF.CSV

  • How to store the pdf file

    hi all,
    i need a pl/sql code to store the pdf file into the oracle database using blob.
    help me.
    Thanks in advance

    rabbott wrote:
    My first question is "where is the PDF file located"? If the answer is "on a file system accessible to the Oracle database" Then you can use directory objects and the DBMS_LOB package. It would look something like this:
    as SYS user do:
    -- assume the PDF files are in /data/documents <font face="tahoma,verdana,sans-serif" size="1" color="#000">files</font>ystem directory
    create or replace directory pdfdir as '/data/documents';
    grant read on directory pdfdir to <USER>;
    as USER do:
    create table mydocs (id integer primary key, doc blob);
    declare
    bf bfile;
    b blob;
    src_offset integer := 1;
    dest_offset integer := 1;
    begin
    -- insert a new blob and return it to local variable
    insert into mydocs values(1, empty_blob()) returning doc into b;
    -- open the bfile for file "summary.pdf"
    bf := bfilename('PDFDIR', 'summary.pdf');
    dbms_lob.loadBlobFromFile(b, bf, dbms_lob.lobmaxsize, dest_offset, src_offset);
    -- done
    commit;
    end;
    /I have the issue which is similar to what you have faced, I'll follow what you said to take a try, Thanks a lot!

  • How to store the certificate file by using import java.security package?

    Hi,
    I have a certificate file whose extension is .p12(So, it conforms to pkcs 12 standart).
    I wanna store this file which is in my file system in my pc. and I wann to store this file to smart card?
    // this two row just load the specified file
    KeyStore keyStore = KeyStore.getInstance("PKCS12");
    keyStore.load(new java.io.FileInputStream(pkcs12File), keyPassword);
    // I need to store keyStore object to smart card. but I do not know how to? Any idea????

    This is not adding external p12 f�le inside the smart card ? Am I right? I want a p12 f�le to add this this file to smart card indside

  • How to store the tld file somewhere else...

    Is it possible to not be forced to always copy the tld file for a tag library into the WEB-INF directory but to pick up the file from a jar/linked resource/project instead.
    The JSTL seems to be able to do it. Though it may be being referenced by some web.xml file that I can't find. The JSTL stores it's template file in the META-INF directory of its jar and then id's the tag file via the uri tag in the template.
    Would doing something similar work for ones own tags?
    I must apologise if this topic has already been dealt with but I did search the forum and on google before posting.

    The JSTL seems to be able to do it. Though it may be
    being referenced by some web.xml file that I can't
    find.
    The JSTL stores it's template file in the
    META-INF directory of its jar and then id's the tag
    file via the uri tag in the template.
    Would doing something similar work for ones own
    tags?
    Yes. Please take a look at post #11 in this thread http://forum.java.sun.com/thread.jspa?threadID=664068, specifically #3 that deals with packaging tag library classes.
    Please note there needn't any references in any web.xml, all you have to is jar your tag classes, have the tlds in META-INF directory. The container picks up the tld definition either from web.xml or from the META-INF of a jar found in WEB-INF/lib (Please see the jsp 2.0 spec section 7.3. The spec itself can be downloaded from http://www.jcp.org/en/jsr/detail?id=152)
    All thats then required to access the tags is the have the jar in the classpath and a taglib directive in jsps.
    You can take a look at this IBM article http://www-128.ibm.com/developerworks/library/j-jsp09023.html?ca=dnt-435 (though it says you require a web.xml entry)
    cheers,
    ram.

  • How can I Export the Image file into Oracle Table

    <tt>
    Hi Folks,
    I have one requirement with me, but i can't able to find the solution for that, so kindly any one give a suggestion for my requirement.
    Let me explain my requirement in detail.. I have one table called SIGN this table contain customer signature image as well as the image of the customer. The SIGN have the following columns
    </tt>
       CREATE TABLE SIGN
      ID                    VARCHAR2(50 BYTE)            NOT NULL,   "This column containing the Customer ID"
      IMAGE_C_FLAG          CHAR(1 BYTE)                 NOT NULL,   "This column containing the whether ID belong to Signature or Photo"
      IMAGE                 BLOB,                        NOT NULL,  "This Column Containing the Image "
      ENTERED_C_BY          VARCHAR2(10 BYTE)
    The SIGN having the following values
    ID                                                 C I IMAGE
    23900033                                           Y S  (BLOB)
    23900034                                           Y S  (BLOB)
    23900035                                           Y S  (BLOB)
    23900036                                           Y S  (BLOB)
    23900042                                           Y S  (BLOB)<tt>
    I want to export those Image from Table into my machine local folder with the extension of .JPEG(C:\IMAGE)
    How can i do that in oracle... please kindly any one give the solution for this..
    This is my Oracle server version
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
    PL/SQL Release 10.1.0.2.0 - Production
    CORE 10.1.0.2.0 Production
    TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production
    Thanks in Advance
    Arun
    </tt>

    Hi Arun,
    Please view the below links. Hope these helps you as there are also of similar discussion.
    Insert Picture (image) using oracle forms
    Insert Picture (image) using oracle forms
    insert image to atable in forms builder
    Re: insert image to atable in forms builder
    Thanks,
    Balaji K.

  • How to store the picuture files in to the Berkeley DB?

    Actually, in a recent project, I need to store the meta pictures into the database, I wonder could I use Berkeley DB to fulfill this function? If possible, is there any samples for illustration?

    Hi,
    As you know, BDB stores records as Key/Data pairs, you could use keys as numbers or any alphanumeric values and in the data part you could store the path or location of the picture files. As for the sample code to do this, you could find in under GettingStarted under examples directory if you have downloaded and installed Berkeley DB.
    I hope this is what you want to do.
    Regards,
    Debsubhra

  • How to fetch the image file from oracle database and display it.

    hi... i've inserted the image file into the oracle database... now i want to retreive it and want to display it... can anybody help me... pls

    not a big deal dude... i fetched the image from database and saved it into my local hard disk.. but when tried to open it,ends up with no preview... dont know what d prob is... any idea... i've inserted the image as bytes n trying to fetch it as binary stream.. is that the problem... here im giving my insertion and retireving code.. jus go through it...
    Insertion code:_
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package PMS;
    import java.io.File;
    import java.io.FileInputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class Browse_java
    static Connection con=null;
    public static void main(String args[])
    try{
    System.out.println("(browse.java) just entered in to the class");
    con = new PMS.DbConnection().getConnection();
    System.out.println("(browse.java) connection string is"+con);
    PreparedStatement ps = con.prepareStatement("INSERT INTO img_exp VALUES(?,?)");
    System.out.println("(browse.java) prepare statement object is"+ps);
    File file =new File("E:/vanabojanalu-/DSC02095.JPG");
    FileInputStream fs = new FileInputStream(file);
    System.out.println("lenth of file"+file.length());
    byte blob[]=new byte[(byte)file.length()];
    System.out.println("lenth of file"+blob.length);
    fs.read(blob);
    ps.setString(1,"E:/vanabojanalu-/DSC02095.JPG");
    ps.setBytes(2, blob);
    // ps.setBinaryStream(2, fs,(int)file.length());
    System.out.println("(browse.java)length of picture is"+fs.available());
    int i = ps.executeUpdate();
    System.out.println("image inserted successfully"+i);
    catch(Exception e)
    e.printStackTrace();
    finally
    try {
    con.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    and Retrieving code is:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package PMS;
    import java.beans.Statement;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jdbc.OracleResultSet;
    * @author Administrator
    public class view_image2 extends HttpServlet {
    * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("image/jpeg");
    //PrintWriter out = response.getWriter();
    try
    javax.servlet.http.HttpServletResponse res=null;;
    int returnValue = 0;
    Connection con = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
    InputStream in = null;
    OutputStream os = null;
    Blob blob = null;
    //String text;
    //text=request.getParameter("text");
    //Class.forName("com.mysql.jdbc.Driver");
    con=new PMS.DbConnection().getConnection();
    System.out.println("jus entered the class");
    //String query = "SELECT B_IMAGE FROM img_exp where VC_IMG_PATH=?";
    //conn.setAutoCommit(false);
    PreparedStatement pst = con.prepareStatement("select b_image from img_exp where vc_img_path=?");
    System.out.println("before executing the query");
    pst.setString(1,"C:/Documents and Settings/Administrator/Desktop/Leader.jpg");
    rs = pst.executeQuery();
    //System.out.println("status of result set is"+rs.next());
    System.out.println("finished writing the query");
    int i=1;
    if(rs.next())
    System.out.println("in rs") ;
    byte[] byte_image=rs.getBytes(1);
    // byte blob_byte[]= new byte[(byte)blob.length()];
    //System.out.println("length of byte is"+blob_byte);
    //String len1 = (Oracle.sql.blob)rs.getString(1);
    //System.out.println("value of string is"+len1);
    //int len = len1.length();
    //byte [] b = new byte[len];
    //in = rs.getBinaryStream(1);
    int index = in.read(byte_image, 0, byte_image.length);
    System.out.println("value of in and index are"+in+" "+index);
    FileOutputStream outImej = new FileOutputStream("C://"+i+".JPG");
    //FileOutputStream fos = new FileOutputStream (imgFileName);
    BufferedOutputStream bos = new BufferedOutputStream (outImej);
    //byte [] byte_array = new byte [blob_byte.length]; //assuming 512k size; you can vary
    //this size depending upon avlBytes
    //int bytes_read = in.read(blob_byte);
    bos.write(index);
    /*while (index != -1)
    outImej.write(blob_byte, 0, index);
    index = in.read(blob_byte, 0, blob_byte.length);
    //System.out.println("==========================");
    //System.out.println(index);
    //System.out.println(outImej);
    //System.out.println("==========================");
    /*ServletOutputStream sout = response.getOutputStream(outImej);
              for(int n = 0; n < blob_byte.length; n++) {
                   sout.write(blob_byte[n]);
              sout.flush();
              sout.close();*/
    outImej.close();
    //i++;
    else
    returnValue = 1;
    catch(Exception e)
    System.out.println("SQLEXCEPTION : " +e);
    finally {
    //out.close();
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    * Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    * Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    * Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    // </editor-fold>
    }

  • How to register the .DTD file in Oracle Apps

    Hi,
    I am getting below error while generating XML file by concurrent program:
    Attaching XML file and .DTD file.
    Do I need to register this .DTD file somewhere?
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    System error: -2146697210. Error processing resource 'http://mbci-ebsdev.itciss.com/OA_CGI/label.dtd'.
    Below is the stored procedure I created to generate the XML file
    create or replace
    PROCEDURE Demo_XML_Publisher (errbuf VARCHAR2,retcode NUMBER,v_customer_id VARCHAR2)
    AS
    /*Cursor to fetch Customer Records*/
    CURSOR xml_parent
    is
    SELECT header_id,ordered_item
    FROM oe_order_lines_all
    WHERE header_id = v_customer_id;
    /*Cursor to fetch customer invoice records*/
    CURSOR xml_detail(p_customer_id NUMBER)
    is
    select a.order_number,a.header_id,a.order_type_id
    from oe_order_headers_all a,oe_order_lines_all b
    where a.HEADER_ID = B.HEADER_ID
    and a.header_id = p_customer_id
    AND ROWNUM<4;
    BEGIN
    /*First line of XML data should be <?xml version=”1.0??>*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="UTF-8"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<!DOCTYPE labels SYSTEM "label.dtd">');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<labels FORMAT="order.btw" PRINTERNAME="KIMBALL1872A" _QUANTITY="1">' );
    FOR v_customer IN xml_parent
    LOOP
    /*For each record create a group tag <P_CUSTOMER> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<label>');
    /*Embed data between XML tags for ex:- <CUSTOMER_NAME>ABCD</CUSTOMER_NAME>*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<HEADER_ID>' || V_CUSTOMER.header_id
    || '</HEADER_ID>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ORDERED_ITEM>' || v_customer.ordered_item ||
    '</ORDERED_ITEM>');
    FOR v_details IN xml_detail(v_customer.header_id)
    LOOP
    /*For customer invoices create a group tag <P_INVOICES> at the
    start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<P_INVOICES>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<variable name= "Order_no">' ||
    V_DETAILS.ORDER_NUMBER || '</variable>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<variable name= "Headr_Id">' ||
    V_DETAILS.HEADER_ID || '</variable>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<variable name= "Order_Type_Id">'||
    v_details.order_type_id||'</variable>');
    /*Close the group tag </P_INVOICES> at the end of customer invoices*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</P_INVOICES>');
    END LOOP;
    /*Close the group tag </P_CUSTOMER> at the end of customer record*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</label>');
    END LOOP;
    /*Finally Close the starting Report tag*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</labels>');
    exception when others then
    FND_FILE.PUT_LINE(FND_FILE.log,'Entered into exception');
    END Demo_XML_Publisher;
    Below is the Label.dtd file structure m using:
    <!ELEMENT labels (label)*>
    <!ATTLIST labels _FORMAT CDATA #IMPLIED>
    <!ATTLIST labels _JOBNAME CDATA #IMPLIED>
    <!ATTLIST labels _QUANTITY CDATA #IMPLIED>
    <!ATTLIST labels _PRINTERNAME CDATA #IMPLIED>
    <!ELEMENT label (variable)*>
    <!ATTLIST label _FORMAT CDATA #IMPLIED>
    <!ATTLIST label _JOBNAME CDATA #IMPLIED>
    <!ATTLIST label _QUANTITY CDATA #IMPLIED>
    <!ATTLIST label _PRINTERNAME CDATA #IMPLIED>
    <!ELEMENT variable (#PCDATA)>
    <!ATTLIST variable name CDATA #IMPLIED>
    Thanks in Advance

    In any case, the dtd is incorrect and that may be why. The element structure is at least look like this.
    <!ELEMENT labels (label*)>
    <!ELEMENT label (CUSTOMER_NAME?, HEADER_ID, ORDERED_ITEM, P_INVOICES*)>
    <!ELEMENT P_INVOICES (variable, variable, variable)>If you want to keep some flexibility on variable's cardinality, you can simply it like this.
    <!ELEMENT labels (label*)>
    <!ELEMENT label (CUSTOMER_NAME?, HEADER_ID, ORDERED_ITEM, P_INVOICES*)>
    <!ELEMENT P_INVOICES (variable+)>Then you add the appropriate ATTLIST for the elements.

  • How to store a pdf file  in a table field.

    Hi,
    I need to store the file in a table field..How we can do this.The file format is pdf..I stored this in application server also..

    during my tries to adapt this code to my needs, following error occured during compilation of the procedure:
    PLS-00201: identifier 'IMAGES.MIME_TYPE' must be declared
    here is my procedure:
    CREATE OR REPLACE PROCEDURE load_file( file_name VARCHAR2 )
    AS file_lob BFILE;
    binary_lob BLOB;
    mime_type images.mime_type%TYPE;
    extension_pos NUMBER;
    BEGIN
    --Use the extension of the file name to determing the MIME-type 
    --The MIME-type for a .pdf file will be application/pdf
    extension_pos := INSTR( file_name, '.' );
    mime_type := 'application/' || SUBSTR( file_name,extension_pos + 1,LENGTH( file_name ) );
    -- Insert a new row into the images table. Get the LOB locator
    -- for the newly inserted row
    -- we will be using that to insert
    -- the content from the file.
    INSERT INTO TESTBLOB( blobid, filename, mime_type, content )
    VALUES( 1, file_name, mime_type, EMPTY_BLOB() )
    RETURNING content INTO binary_lob;
    -- Open up the file in the IMAGES directory named file_name,
    -- load that file into the newly created LOB locator, and
    -- close the file
    file_lob := BFILENAME( 'TESTDIRECTORY', file_name );
    dbms_lob.fileOpen ( file_lob, dbms_lob.file_readOnly );
    dbms_lob.loadFromFile( binary_lob,file_lob,dbms_lob.getLength( file_lob ) );
    dbms_lob.fileClose ( file_lob );
    END;
    how do I have to adjust the declaration of the mime_type variable respectively what does images.mime_type%TYPE mean?
    katharina

  • How to store a pdf file in a table

    Hi
    In my project i have to store a pdf
    file in the table column.
    can anyone tell what wil be the column type
    while creating the table in oracle 7.3.4
    Thanks
    Alok

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alok Hota ([email protected]):
    Hi
    In my project i have to store a pdf
    file in the table column.
    can anyone tell what wil be the column type
    while creating the table in oracle 7.3.4
    Thanks
    Alok<HR></BLOCKQUOTE>
    Since you have to store a binary file you
    can use LONG RAW.
    Thorsten

  • How to read the CSV Files into Database Table

    Hi
    Friends i have a Table called tblstudent this has the following fields Student ID, StudentName ,Class,Father_Name, Mother_Name.
    Now i have a CSV File with 1500 records with all These Fields. Now in my Program there is a need for me to read all these Records into this Table tblstudent.
    Note: I have got already 2000 records in the Table tblstudent now i would like to read all these CSV File records into the Table tblstudent.
    Please give me some examples to do this
    Thank your for your service
    Cheers
    Jofin

    1) Read the CSV file line by line using BufferedReader.
    2) Convert each line (record) to a List and add it to a parent List. If you know the columns before, you might use a List of DTO's.
    3) Finally save the two-dimensional List or the List of DTO's into the datatable using plain JDBC or any kind of ORM (Hibernate and so on).
    This article contains some useful code snippets to parse a CSV: http://balusc.xs4all.nl/srv/dev-jep-csv.html

  • How to store the contents of a file

    Hi,
    I'm using forms6i and database 10g.
    Through forms if a user selects a filename , and clicks a button or something,
    the contents of the file should be saved in the database.
    The file can be of any type, like .doc,.pdf,.xml,.html etc...
    and the contents filed will be of type varchar
    Please help me do this..
    Thanks

    Do you really want to save the "Content" of a file or the file itself? If you try to save the contents of a .doc or .pdf in a column with a VARCHAR2 datatype, you are going to corrupt the contents of the file since these file types have binary data in them as well as text. I think you would have greater success storing the actual file in a BLOB column.
    Here are a few Oracle Support documents that discuss how to store and retrieve files stored as BLOBs in the database.
    Doc ID: 168277.1 - How to Upload Binary Documents Back to Database BLOB Column from Forms
    Doc ID: 330146.1 - How to write BLOBs Stored Inside the Database Out to Files.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to store the images in Oracle?

    Hi,
    I am a new developer, trying to find out how to store the images in Oracle. Is there anyway that I can store the images in Oracle and insert them into my html file?
    Thanks!
    Sarah

    There is a simple image example available from OTN.
    From the OTN main page, go to Products --> interMedia --> Sample Code. The name of the example is "Load rich media content with a browser."
    This example loads and retrieves an image from an Oracle8i database through a web page using the Oracle interMedia Web Agent.
    Hope this helps.
    null

Maybe you are looking for

  • Thumbnails of Adobe formats no longer available after installing CC

    After installing CC and removing CS6, many formats (pdf, ai, tif, etc) no longer display as thumbnails in desktop/explorer but instead have reverted to program document icons. I have tried http://www.josh.biz/technical-notes/view-thumbnail-images-for

  • Doubt with WS Adapter in PI 7.1

    Hello everybody, I have a doubt regarding the WS Adapter in PI 7.1, I understood it works only for SAP Systems, am I correct?, I'm asking because I'm going to have a scenario like this Oracle Peoplesoft Payroll System-> SAP PI 7.1-> SAP ECC now I've

  • Connecting Ipod Touch to the internet

    Hi, I've been trying to connect my ipod touch to the internet. It picks up my router and connects but won't let me access the internet? I've reset network settings, renewed license's. Is there something else I can try? x

  • Varient configuration & batch management

    Dear all, How varient configuration is related with MM,Which are the related T-codes for it .How it is configured. What is difference between material maintainance through varient configuration & Batch management. Is it possible to maintain material

  • Ejb Client Access (ClassCastException)

    This is the problem which i am facing for two weeks. My deployment is doing fine. When i try to run my Client i get an error like java.lang.ClassCastException and some sentences related to PortableRemoteObject.narrow. I am not able to fix the bug. Ca