Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    28

    Unanswered: Trouble creating csv file headings

    I am having a problem creating a csv (Comma Separated Value) file with the headings I want. Basically, I am able to create the file but can not seem to change the headings. I am sure it is just matter of placing these in the proper order for the sql to read it, but I have not had any luck.

    This works and delivers a comma delimited format:

    Code:
     
    Sample, (not my code but will give you an idea)
     
    Select
    BK || ‘,’ ||
    BS || ‘,’ ||
    BTOT || ‘,’
    From inventory
    Where
    Etc….


    But if I try to declare the headings I run into errors:

    Code:
    Select
    BK “Bricks” || ‘,’ ||
    BS “Brick Size” || ‘,’ ||
    BTOT “All Bricks” || ‘,’
    From inventory
    Where
    Etc….
     
    BK “Bricks” || ‘,’ ||
               *
    ERROR at line 2:
    ORA-00923: FROM keyword not found where expected
    
    I have tried to place the heading declaration at the end, in the middle… nothing seems to work.
    Any Ideas?

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Do it like this


    set pagesize 0

    Select 'Bricks,Brick Size,All Bricks'
    from dual
    union all
    Select
    BK || ‘,’ ||
    BS || ‘,’ ||
    BTOT
    From inventory
    Where
    Etc…. ;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Sep 2004
    Location
    London, UK
    Posts
    565
    Or

    PROMPT Bricks,Brick Size,All Bricks

    SELECT ...

Posting Permissions

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