Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Posts
    47

    Unanswered: How to create a flat file?

    Hi,

    Can anyone tell me how to create flat file with fixed length in sqlplus?

    Thanks,

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Can anyone tell me how to create flat file with fixed length in sqlplus?
    It can not easily be done.
    SQL*Plus is the wrong tool for this task.
    define "fixed length"
    Who gets to decide upon the exact length?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2007
    Posts
    47
    Is there any other way. Below is my table description.

    I have a oracle table with fields acct varchar2(15), lname varchar2(15) and so on. Totally I have 20 fields. I have loaded the data data file which has 10,000 records. How do I covert this oracle table into flat file for the clients to view it.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    sqlplus username/password
    set lines 4095 trimspool on pages 0
    spool flatfile.lis
    select * from my_table;
    spool off
    exit

    now flatfile.lis contains what you requested
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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