exporting an oracle db table to a flat file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • camja
    New Member
    • Sep 2007
    • 2

    exporting an oracle db table to a flat file

    Hi, I want to export an oracle database table to a flat file - can anyone tell me how to do this ?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Hi camji

    Welcome to TSDN.

    Try to use SPOOL command from SQL*PLUS.

    ex
    ======
    spool 'd:\data.txt'

    select * from inventory;

    spool off

    next check for the file. if the file does not exist that will be created.

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      Use IMPORT command in case if you want to import from one database and export it to another database

      imp scott/tiger file=emp.dmp full=yes
      imp scott/tiger file=emp.dmp fromuser=scott touser=scott tables=dept

      Comment

      • camja
        New Member
        • Sep 2007
        • 2

        #4
        Originally posted by debasisdas
        Hi camji

        Welcome to TSDN.

        Try to use SPOOL command from SQL*PLUS.

        ex
        ======
        spool 'd:\data.txt'

        select * from inventory;

        spool off

        next check for the file. if the file does not exist that will be created.
        Thankyou ! so simple and obvious really - great.

        Comment

        Working...