Export data to fixed length text file with ociuldr

Links: http://www.dbatools.net/mytools/ociuldr-fixed-length-unload.html

    Sqlldr is much faster for fixed legnth text file, so someone suggest me to add this feature in ociuldr utiltiy, now it supported. When you use a space char as the field separator, it will generate fixed-length text file.

ociuldr user=/ \
  query="select owner,object_name from all_objects" \
  field=0x20 table=test

    And I disable some code to make the output clean enough.

      0 rows exported at 2009-02-17 17:23:31
  17330 rows exported at 2009-02-17 17:23:32
        output file uldrdata.txt closed at 17330 rows.

    Take a look at the output file, it's fixed length now. But you cannot customize the width of each column.

SYS                          ACCESS$
SYS                          AGGXMLIMP
SYS                          AGGXMLINPUTTYPE
SYS                          ALL_ALL_TABLES
SYS                          ALL_APPLY
SYS                          ALL_APPLY_CONFLICT_COLUMNS
SYS                          ALL_APPLY_DML_HANDLERS
SYS                          ALL_APPLY_ERROR
SYS                          ALL_APPLY_KEY_COLUMNS
SYS                          ALL_APPLY_PARAMETERS
SYS                          ALL_APPLY_PROGRESS

    In the auto-generated sqlldr control file, it will tell you each column's width.

--
-- Generated by OCIULDR
--
OPTIONS(BINDSIZE=16777216,READSIZE=16777216,ERRORS=-1,ROWS=50000)
LOAD DATA
INFILE 'uldrdata.txt' "STR X'0a'"
INSERT INTO TABLE test
FIELDS TERMINATED BY X'20' TRAILING NULLCOLS
(
  OWNER POSITION(1:30) CHAR(30),
  OBJECT_NAME POSITION(31:60) CHAR(30)
)

    I haven't do enough test, if you feel something to improve, just tell me.

Comments (2)

Hi, Charlie Yi, Can you help to test this new feature of ociuldr?

Post a comment

Remember Me?

« Previous | Main | Next »

Powered by
Movable Type 5.01