Home » RDBMS Server » Server Utilities » How to use SQL*Loader to load binary data
How to use SQL*Loader to load binary data [message #368245] Fri, 13 October 2000 12:29 Go to next message
Xiaoling Fang
Messages: 2
Registered: October 2000
Junior Member
I am trying to figure out a way to load binary data from an operating system file into an Oracle table.

I have created the file using Sybase bcp utility. Each data record has three data fields. The first two data fields contain ASCII data and are terminated with the character '|'. The third data field contains binary data. Each data record is terminated with a text string 'END-OF-RECORD'.

As far as the binary data in the third data field is concerned. Any printable and non-printable charters you can think of, you can find in the data. That's why the text string 'END-OF-RECORD' is used to mark the end of the record.

Your help will be greatly appreciated.
Re: How to use SQL*Loader to load binary data [message #368246 is a reply to message #368245] Fri, 13 October 2000 16:07 Go to previous messageGo to next message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,
You can use the RAW data type to store the binary as it is.
Try this....
create table mixed_dat(ascii1 number, ascii2 varchar2(), binary1 raw());

control file.
load data
infile 'C:\data\mixed_data.txt'
replace into table mixed_dat
(ascii1 number terminated by '|'
ascii2 varchar2() terminated by '|'
binary1 raw terminated by 'END-OF-RECORD')

Good Luck
Bala
Re: How to use SQL*Loader to load binary data -- Help!!! [message #368248 is a reply to message #368246] Fri, 13 October 2000 17:00 Go to previous message
Xiaoling Fang
Messages: 2
Registered: October 2000
Junior Member
Bala, thanks for the example.

I have tried the same thing before. But the problem is that you can't use a delimiter with a raw data field. A delimiter can only be used with a data field of one of the following types: CHAR, DATE, MLSLABEL, or numeric EXTERNAL.

I have gotten this error message when tried use a delimiter: SQL*Loader-261: illegal use of TERMINATED BY for RAW field.
Previous Topic: SQL*Loader - multiple line load - HELP!!
Next Topic: can't login to database
Goto Forum:
  


Current Time: Thu May 19 22:34:56 CDT 2022