DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: sql statement - comma delimited file

  1. #1
    Join Date
    Oct 2001
    Location
    Hornchurch, Essex UK
    Posts
    132
    Can a sql statement be used to generate a comma delimited file in Oracle?

    This is pretty urgent.

    Thanks

  2. #2
    Join Date
    Jan 2002
    Posts
    57
    You can do something like this:

    > desc t1
    Name Null? Type
    ------------------------------- -------- ----
    A VARCHAR2(10)
    B VARCHAR2(10)
    C VARCHAR2(10)

    > select a || ',' || b || ',' || c from t1;

    A||','||B||','||C
    --------------------------------
    a1,a2,a3
    b1,b2,b3
    c1,c2,c3

    You could spool the output to a file.

    --
    Paul

  3. #3
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Or you can "SET COLSEP ," in SQL*Plus and just SELECT * FROM ...

    Ales

  4. #4
    Join Date
    Oct 2001
    Location
    Hornchurch, Essex UK
    Posts
    132
    Thanks

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