1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

procedure to unload data

Discussion in 'SQL PL/SQL' started by zulu, Mar 9, 2011.

  1. zulu

    zulu Guest

    Hi,
    I'm a newbie to oracle. Can someone help me with a procedure/sql to unload data to a csv file with delimiter(|)

    Thanks in Advance!
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You will need to generate that SQL on your own since you have not provided any table structure; it's a fairly simple task:

    select a||'|'||b||'|'||c||'|'||....
    from mytab;

    The || is a concatenation operator in Oracle. Spool the output to a file after you have the records built the way you want them.
     
  3. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    See what Tomkyte tells about "Export to csv"