Results 1 to 5 of 5

Thread: Oracle SQL (RESOLVED)

  1. #1

    Thread Starter
    Frenzied Member Robbo's Avatar
    Join Date
    Jan 2001
    Location
    Bradford
    Posts
    1,143

    Resolved Oracle SQL (RESOLVED)

    is there a way of copying contents of a SQL string in SQL Plus to copy the contents for the statement to a txt, or csv file? need on large tables? i know in dos you can use ">> dir.txt" anything like this in SQL??

    Thanks in Advance
    Last edited by Robbo; Dec 9th, 2004 at 05:17 AM.
    -----------------------------------------------
    "The hall is rented,"
    "the orchestra is engaged,"
    "its now time to see if you can dance!"
    Q, Q-Who, Star Trek The Next Generation
    -----------------------------------------------
    General Work day

    -----------------------------------------------
    DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle

  2. #2
    Hyperactive Member csar's Avatar
    Join Date
    Mar 2002
    Location
    Siam
    Posts
    288
    use spool to keep in text file

    SQL > spool c:\output.txt

    and off them when finish.

    SQL > spool off
    Don't leave it till tomorrow, Do It Now!
    5361726176757468204368616E63686F747361746869656E

  3. #3

    Thread Starter
    Frenzied Member Robbo's Avatar
    Join Date
    Jan 2001
    Location
    Bradford
    Posts
    1,143
    so example

    SQL > spool c:\output.txt

    SQL >SELECT * FROM table1 WHERE Field = 'Yes'

    SQL > spool off

    would this put into a text file, will this put headers in too? column titles or just data, just want to archive data off
    -----------------------------------------------
    "The hall is rented,"
    "the orchestra is engaged,"
    "its now time to see if you can dance!"
    Q, Q-Who, Star Trek The Next Generation
    -----------------------------------------------
    General Work day

    -----------------------------------------------
    DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle

  4. #4
    Addicted Member
    Join Date
    Aug 2004
    Posts
    176
    everything that comes between spool and spool off will go into the text file
    u cannot start the same txt file once u have spooled off.
    also the spool is stopped if u disconnect.

  5. #5

    Thread Starter
    Frenzied Member Robbo's Avatar
    Join Date
    Jan 2001
    Location
    Bradford
    Posts
    1,143
    great thats a start, cheers for your help
    -----------------------------------------------
    "The hall is rented,"
    "the orchestra is engaged,"
    "its now time to see if you can dance!"
    Q, Q-Who, Star Trek The Next Generation
    -----------------------------------------------
    General Work day

    -----------------------------------------------
    DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width