CSV file enclosed by "

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bky88
    New Member
    • Nov 2008
    • 1

    CSV file enclosed by "

    Hi all!

    I need some help with a csv file im exporting. The file is coming like this:

    000050222,1,AB2 500AW,2007,10,3 2,2,+1.00

    and i need to enclose some colums with double quotes so the file could look like this:


    000050222,"1"," AB2500AW","2007 ","10","32","2" ,"+1.00"

    im using oracle 10g, on Unix OS, and im new to Oracle


    Any help will be useful.
    Thanks!
  • Pilgrim333
    New Member
    • Oct 2008
    • 127

    #2
    Hi,

    You can escape it by using "" eg.

    Select ""test"" from dual;

    Will result in "test"

    Pilgrim.

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      Please post your query that you are using to export the data from oracle table in to a csv file?

      Comment

      • Pilgrim333
        New Member
        • Oct 2008
        • 127

        #4
        My Booboo,

        That ofcourse should be
        Code:
         select ' "test" ' from dual
        Using it in a pl/sql procedure in which you are generating an output string it would be

        Code:
         l_text := ' " ' <variable> || ' "; '  <etc> ;
        (get rid of the spaces between the single and double quotes)

        Pilgrim

        Comment

        Working...