Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Graphics 1

Status
Not open for further replies.

SiMCard

Technical User
Oct 16, 2001
17
GB
My client wants to have a table holding a Customer Number and a scanned copy of that Customer's signature. It is planned to maintain this through an Access front-end (hmmm...).

I've trawled the V2R5 documentation and can find nothing specific regarding file storage other than the BYTE and VARBYTE definitions.

Does anyone have experience of doing this, or have any other ideas about how it can be achieved (specifically inserting / retrieving the data and displaying it)?

Any help appreciated.

Si M...

PS: Hi Rog - how's life?
 
Larger than VARBYTES are BLOB columns, next page on your "SQL Reference: Data Types and Literals" manual ;-)
 
Er... Thanks - but the manual I've got (V2R5.0) only references BLOB as a V2R5 reserved word - the next page after VARBYTE is the next Chapter on Default Value Control Phrases. Hmmm... Looks like an update is required...

I'll go have a shufti round the Teradata site.

Cheers, though

Si M...
 
Hi,
There is a program in the CLI Installation called BLOBSRVR.

The Sourece code ias in the sample directory.

Basically it creates a table

filename char(30)
partno integer
data varchar(32000) (or 64000)

then it basically takes you graphic and breaks it up into NUM 32K parts.

Code:
    fd = open(filename)
    x = 0;
    while ( read(fd,buffer,32000) )
      x ++;
      insert into blobtbl
          values (filename,x,buffer);
    end
    close fd;

then to get the data back out you specify

Code:
    sel * from blobtbl where
       filename = 'filename'
         order by partno;

    fd = open(newfile);
    while ( num = fetch(buffer))
       write (fd, buffer, num );
    end

    close fd;

Sorry the pseudo code is part Perl and Part C with maybe a little pascal.

Like Is aid you should be able to find the code for the BLOBSRV.EXE in the CLI samples directory.
 
Thanks tdatgod - first things first, I've checked the client's version (V2R5.1.2.16), so that's fine.

I must get an updated copy of the manual, also.

Interesting pseudo code mix B-) and I'll be using VB - but it makes sense.

Thanks again

Si M...
 
Simon,
Have you worked this out yet. Any chance of posting the solution?

Roger...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top