DATABASE TO FLAT FILE

Hi every one !!pls help me i wanna transfer my data from table to flat file.i have even used a procedure but it throws an error for utl in init ora ,so tell me how to configure init ora and i am using
utl_file.file_type.
thanx to all

To use utl_file I believe you need to set up the init.ora with the name of the directory that you want to write to. See http://technet.oracle.com/doc/server.815/a68001/utl_file.htm#998101 for details.
You can also do it anoter way which is with SQL*Plus and just spool the file, for example:
SQL>spool emp.dat
SQL>select empno, ',', ename, ',' from scott.emp;
123,SMITH,
125,Jones,
SQL>Spool off;
This will wrtie a file named emp.dat to the directory which SQL*Plus is run from.

Similar Messages

  • Designing relational database from flat file

    hi all,
    I have little background in the filed of databases. As my work task I have to design a realtional databse from a flat file with 60 fields. would you please guide me how to or, the documents that i can refer to develop a good and efficient design.? I would appreciate your help and would love to work and read and learn to any level to get it right.have a good day

    user501335 wrote:
    Thank you very much Gerwin and Edstvens for your replies. I guess I must have elaborated a little more.
    Gerwin, I have gone throught the link you have sent me, and it was good to know that I am already aware of till this level.. Thank you for the help, can you please suggest little more so that i can go a little advance. we would be developing it for sql server2008.
    edstevens, So kind of you to send me a good suggestion.I will keep in mind while working on it.Would you please like to suggest me something more?
    No.
    If people would just get Third Normal Form burned into their brains, a lot of other problems would go away.
    wish you both a good day

  • ESB not moving data from database to flat file

    Using ESB, created an database adapter/routing service (polling for changed records) & file adapter to write all records from a database table to a flat file as a series of XML entries in the file. I only get the last record from the database into the flat file. Using JDev 10.1.3.2 and SOA Suite 10.1.3. Have a 'status' column in the source database table that is set to 'PROCESSED' when the record has been processed. After I get the one XML element, representing the last record in the database, I look at the database table and ALL rows have their 'status' column set to PROCESSED - the field was null before the database table was processed.
    How do I get ALL of the records into the flat file?
    Thanks - Casey

    Hi.
    Check this:
    ESB File Adapter: Append to log file not supported???
    Denis

  • Database to flat files

    What would be the simplest approach to connect to
    a database table , and transfer its content to a flat file.
    I mean could it be the regular way of dumping the resultset
    in a file using java.io classes, or any other workaround, for
    a better performance.
    Thanks in advance

    I always wonder, why this questions gets asked over and over again. Writer out = new BufferedWriter(new FileWriter("data.txt"));
    ResultSet rs = connection.executeQuery("SELECT * FROM the_table");
    int colCount = rs.getMetaData().getColumnCount();
    while (rs. next()
      for (int i=0; i < colCount; i++)
          if (i > 0) out.write("\t");
          Object value = rs.getObject(i + 1);
          if (value == null || rs.wasNull())
              out.write("NULL");
          else
              out.write(value.toString());
      out.write("\n");
    rs.close();
    out.close();

  • Exporting data to flat files

    Hi,
    Is it possible to export data from any database to flat files using SQL developer and also automate the process by including some sort of scheduler or script?
    Thanks,
    Nitesh

    If the database is Oracle you can export the contents of table to a flat file by right clicking on the table instance and selecting "Export Data" menu item and then selecting the export format

  • Error Loading data from oracle to flat file in oracle data integrator

    Hi All,
    I m trying to load data from oracle database to flat file.But I am getting the error at step "Insert new row"(integration)
    Error Message is:
    7000 : null : com.sunopsis.jdbc.driver.file.b.i
    com.sunopsis.jdbc.driver.file.b.i
         at com.sunopsis.jdbc.driver.file.b.d.setDate(d.java)
         at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
         at com.sunopsis.sql.SnpsQuery.addBatch(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    I m nt able to find out the exact reason.Can anyone help me in that.

    yes...I got the mistake which i was doing.Actually the target file data type should be string and I was defined it diffrent for each column.
    When I chnged the data type to string,data get loaded to target table.
    Thanks for your reply.

  • Saving database records in a flat file

    I am trying to save data from relational database into a flat file and then read back records based on the certain criteria.
    What will be a good approach for me? Should I use random access files or sequential files for storing and
    retrieving data or is there some other technique that is more efficient that I can use.
    Thanks

    I don't think that reading database records from a flat file based on certain criteria is a good approach, no matter how you produce the flat file. Using a second database table makes more sense to me, especially since you already have database software available and ready for use.
    (You asked about a "good approach" and then you wanted a technique that was "more efficient". Those two aren't the same thing at all.)

  • Flat file to Oracle Database - Invalid Month

    Hi All
    I am New to XI and trying to create a simple interface between Legacy system (flat file) and Oracle database.
    I have some date fields in the Oracle table.
    When i run the interface it says "invalid month" with some SQL exception number.
    I am using (mm/dd/yyyy) format for the date.
    Is there any conversion i need to do. I am using XML SQL format for Oracle database.
    Any help is appreciated.
    Thanks
    Nagakishore

    Hello,
    Oracle is very picky with the way date is stored. Assume that you have a field datefield that you need to save. In mapping add an attribute hasqQuote and set it to "NO". When mapping the value to the node use to_date as shown below.
    <DateField hasQuot="No">
       TO_DATE("2004-07-20", "yyyy-mm-dd hh:mi:ss")</DateField>
    cheers,
    Naveen

  • Uploading Data from a Flat file into Oracle Database

    Hi,
    I am a novice to Java . SO, please bear with me. I have a reqiurement where I have a flat file or excel file from which I need to read the data and insert into Oracle Database. The falt file will exist on the client machine. I have been reading and I see this can be done through I/O Streams. Correct me if I am wrong. I am looking for a sample code to get started. Any Java expert has an answer for it, I will appreciate it.
    Thanks

    Try UploadBean. It allows to upload files (from a browser) in Oracle.
    http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html
    You will find JSP and servlet samples.

  • Convert flat file to XML document and store into Oracle database

    First:
    I have a flatfile and created external table to read that file in Oracle
    Now I want to create an XML document for each row and insert into Oracle database, I think that XMLtype.
    Could you please provide me some information/steps.
    Second:
    Is there performance issues, because everyday I need to check that XML document stored in the database against the in coming file.
    Thank You.

    Oracle 11g R2 Sun Solaris
    Flat file is | (pipe delimited), so I did create an EXTERNAL Table
    row1     a|1|2|3|4
    row2     b|2|3|4|5
    row3     c|6|7|8|9
    I want to store each record as XML document. So it will be easy to compare with next day's load and make insert or update.
    The reason is:
         First day the file comes with 5 columns
         after some days, the file may carry on some additional columns more than 5
         In this case I do not want to alter table to capture those values, if I use XML than I can capture any number of columns, CORRECT!. Please make me correct If I am wrong.
         This is the only reason to try to use the XMLType (XML Document)
         On Everyday load we will be matching these XML documents and update it if there is any column's value changes
    daily average load will be 10 millions and initial setup will be 60-80 millions
         Do I have anyother option to capture the new values without altering the table.
    Please advise!.

  • Looking for a flat file database

    Hi,
    I am looking for a 'database' for my Java-Project. My requirements are: no ODBC, no DB-Server, all Windows Systems.
    I think my only option is a flat file based system. So my Question:
    Which database do you know, or do you advice an other solution for my problem.
    Thanks for your answers

    Why don't you go to the two sites above and look through their documentation?
    Edit: And why did you resurrect a four year dead thread for this?

  • SQL (Injection) Vs Flat File TXT Vs XML (XPath Injection) For Database.

    I will have to deal with robust login sessions so I need some advice on what type of database and language I will use.
    PHP and MySQL is the choice but I hear that flat file TXT are more faster so I am thinking about Perl.
    Perl is very flexiple and have many advantages but why do many folks use PHP.
    SQL and XPath injection are becoming more frequent plus MD5 and SH512 have been cracked by some angry folks.
    The Perl community is becoming very small so it will be difficult to receive support if I have a specific problem.

    In our projects we are extracting SMS messages and
    based on the
    MISDN (Telephone number) of each SMS we are fetching
    the corresponding
    account information (server name and password) from
    the database through (connecting through)
    webservice.The data is stored in the DB which you are accessing through a webserivce and that's too slow and unreliable so you are caching the results in a text file...
    That's horrible. The party responsible for the webservice should be fixing it or you should rethink the architecture. All this extra complexity and basically it's just causing problems for you. You'd be better off just accessing the DB directly. I assume this is possible since you know there is a database. In a good SOA architecture, you should not know or care about where the data is persisted.
    This webservice connection is slow/unreliable so a
    local copy of the
    MISDN number and corresponding account information
    are stored/updated in flat files tp prevent repeated
    accessing through webservice.
    My question is-which will be faster for accessing,
    using txt file or xml or a different format.I don't think it's going to matter much at all for the numbers you site, unless you are running this on a 20 year old PC or something.
    But I think you are addressing the wrong problem.

  • How to upload a Flat file into sap database if the file is in Appl'n Server

    Hello Sap Experts , Can you tel me
    " How to upload a Flat file into sap database if the file is in Application Server.
    what is Path for that ?
    Plz Tel Me its Urgent
    Thanks for all

    Hi,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    * Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • Diifferent java apllications write to the same flat file database

    I have a variety of java applications that need to be able to write diagnostics to the same flat file database (containes just one file). Could somebody give me the pointers what is the best way to write my applications so that different application not need to worry about the updates in file?
    They should be able to write whenever they want.

    JavaFunda wrote:
    I have a variety of java applications that need to be able to write diagnostics to the same flat file database (containes just one file). Could somebody give me the pointers what is the best way to write my applications so that different application not need to worry about the updates in file?I guess my question would be: is it a file or a database (as in an RDB)?
    I think EJP's post was aimed at syncing writes to files (and he'll definitely tell me if I'm wrong : )), but it may be redundant if, in fact, your output is going to a database.
    Also, Java has some quite sophisticated logging applications (I believe log4j is quite popular; but there are others), which may serve your needs.
    Winston

  • FLAT file to Database load

    Hi All,
    we have been using OWB 10.2.0.3 version from past 6 months till now we are loading database to database.
    Data base version : 10.2.
    OWB version : 10.2.0.3
    Server operating system : Sun Solaries (10)
    Client operating system : Windows Xp.
    I would like to share some information to u and all.
    i have installed owb10gr2 on personal PC it has windows Xp operating system. i have one simple mapping for FLAT file.
    Steps handled by me to populate data flat file to Database.
    i have created one folder in C drive then i have created directory and i gave privilages to access that folder.
    i have created external table for flat file manually.
    after that i imported external table to mapp target table. it's working fine and data also loading.
    i am still getting confuse Flat file handling with SUN SOLARIES OPERATING SYSTEM
    How do we handle flat file in UNIX environment.
    How create directory and how to give access privilages.
    how to create EXTERNAL table with OWB.
    Could u please help me
    Regards.
    venkat.

    Hi,
    i have logged in sys and i created directory then gave privilages to 'c:\test_file'.... test_file is folder name which i created folder in windows PC. server is SUNSOLARIS.
    in OWB i have created table based on that file with delimited. below mentioned column names and values.
    no     name     sal     coom
    100     aa     10000     1000
    200     bb     20000     2000
    300     cc     30000     3000
    400     dd     40000     4000
    after that i have created external table under source module and then deployed that table in database table has created sucessfully but while using select statement it's showing error.
    ex: select * from table ( error)
    ORA-29913 error in executing ODCIEXTTABLEOPEN callout
    ORA-29400 data cartridge error
    KUP-04040 file abc.csv in test_v_s_loc not found
    ORA-06512 at "sys.ORACLE_LOADER",line 19
    i have done/given privilages like below
    create or replace directory sample_owb as 'C:\test_file'
    grant read,write on directory sample_owb to ods_inb_stg
    what is the cause and how to handle and resolve. could u please help me.
    regards,
    venkat.

Maybe you are looking for

  • How many users have been logged on by this month

    I need to do a list of the users have been logged on by this month in the central instance and in the application servers. Someone can help me? I will apreciate your answers. Best Regards.

  • Selection problem at MF60

    Hi Experts, could any of You pls help me to solve an issue related to MF60 order selection? I have a WM - PP configured interface for material staging with a control cycle 3 released order parts, and use MF60 to issue material staging. Only REL produ

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards, Sir, hope you will in best of health and wealth by the grace of God, Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i

  • Cancelling Verizon services..​..

    I just got off the phone with Verizon customer service after I learned that my bundle price that I am paying $124.99 for has been reduced by $20 per month.  I am a loyal customer of 6 years and they won't give me a discount because I already received

  • ITunes 10.5 keeps failing to install - missing components

    Hi, I'm really hoping someone can help me - I went to upgrade to 10.5 (64-bit). Initially I was told that it failed to install properly and I would have to manually install the different components (yeah I'm a tech-moron), which I tried to. But they