Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 08 Nov 2002 @ 08:30:21 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: How to store a JPEG in a table?
 
From:   Greg Duncan

My original problem was how to store a large file (BLOB a binary large object) into a Teradata table using BTEQ.

My original code to create the table was correct:

BTEQ code for the table:

create table filedb
(
piece varbyte(32000)
);

But the code for storing the data the varbyte should be just byte. So instead of:

using
piecex (varbyte(32000))

should be:

using
piecex (byte(32000))

BTEQ code:

.import data file = data
using
piecex (byte(32000))
insert into filedb
(
   piece
)
values
(
   :piecex
);
.quit

Also when I was creating the data file the first two bytes are the length of the data and the last character in the file data is a LF. I had the length and the LF at the end of the data file but I had the low/high bytes for the data length switched.

Thanks to Kuroda Akira from NCR Japan for helping solve my problem!

--

--------------------------
Greg Duncan
UNIX System Administrator
Cameron University
Lawton Oklahoma
--------------------------



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023