Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Posts
    13

    Unanswered: Oracle to Fixed-Width Flat File

    Hi,

    I need to create a fixed width flat file from PL/SQL.

    Now I know I can use utl_file to create a CSV(Comma Separated Values) file. (Unfortunately, this requires a reboot of instance and a hard code of directory value)

    But, I don't want a CSV file, I want a fixed width file.

    I would like to encapsulate this in a PL/SQL procedure and not require SQL Plus.


    Any ideas?

    Thanks,
    Jeff

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Concatenate the result set ... spool out to a file turning off
    heading, verify, trimspool... set linesize to the linesize of the output

    example ...

    select username||chr(9)||sid||chr(9)||serial#||chr(9)||pr ogram from v$session;

    HTH
    Gregg

  3. #3
    Join Date
    Apr 2003
    Posts
    13

    Flat File

    Can I run SQL*Plus script from within PL/SQL?

    I have some pl/sql and as a last step I want it to create the fixed width file.

    Thanks,
    Jeff

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    I create .BAT files that run sqlplus @filename ... The file that gets
    run is sql commands that spool ...

    Gregg

Posting Permissions

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