Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 05 Nov 2002 @ 08:55:15 GMT


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


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

I'm working on a project that requires storing graphic images (JPG, etc) into a Teradata database but finding it hard to find documentation to help in this endeavor.

Would anyone be able to provide samples of your SQL code that allows you to store data into a VARBYTE or VARGRAPHIC type. I'm inserting a two byte field at the beginning of the graphic file to indicate the length of the file and putting a new line at the end of the file, but it is not working. Do you have any documentation on creating the data file from scratch and then uploading it to Teradata?

BTEQ code for the table:

create table filedb
(
piece varbyte(64000)
);

Here is the BTEQ code I'm using to try to load the data:

.import data file = data
.repeat *
using
piecex (varbyte(64000))
insert into filedb
(
  piece
)
values
(
  :piecex
);
.quit

I get the error message:

*** Failure 2673 The source parcel length does not match data that was defined.

So obviously my length I'm putting at the beginning of the file is incorrect.

Thank you for any help you can provide.

--

--------------------------
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