How do I load chr(01) delimited text using SQL Loader?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How do I load chr(01) delimited text using SQL Loader?

  1. #1
    Join Date
    Apr 2004
    Location
    ny,ny
    Posts
    24

    How do I load chr(01) delimited text using SQL Loader?

    basically I have a flat file with fields terminated by chr(01) and each row is terminated by chr(02).

    for now, i have to manually change the char(01) character to something meaning ful like #. i dont' want to modify my flat file at all.

    here is my control file:

    load data
    infile '/text.txt' "str'chr(02)'"
    truncate
    into table test_table
    fields terminated by "chr(01)"
    trailing nullcols
    (composer,
    p_id,
    t_id)

    obviously this control file won't work but
    it conveys what i would like to do; fields terminated by chr(01) and the newline or new row is separated by chr(02)

    here is a sample of the data file:

    duck, daffy char(01) 1234 char(01) 444 chr(02)bunny, bugs chr(01) 345 chr(01) 555 chr(02)pig, porky..etc

    thank you

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    Look at the section that explains X'hex' in http://download-west.oracle.com/docs.../ch05.htm#5352
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    You can use X'nn' when nn is the hex value.


    SNAP !
    Last edited by DaPi; 04-08-2004 at 01:26 PM.

  4. #4
    Join Date
    Apr 2004
    Location
    ny,ny
    Posts
    24
    thanks guys. I went to

    asciitable.com and lookup the
    hexadecimal equivalents on chr(1) and
    chr(2). this file works:


    load data
    infile '/text.txt' "str X'02'"
    truncate
    into table test_table
    fields terminated by X'01'
    trailing nullcols
    (composer,
    p_id,
    t_id)

Posting Permissions

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



Click Here to Expand Forum to Full Width