Like to buy DB2 but have concerns.. 
Author Message
 Like to buy DB2 but have concerns..

I am considering purchasing DB2 but I have several questions I need answered
first...

I have several applications written in Approach Release 9 which I would like
to view jpeg images from within Approach.  I do not want to cut and paste
each image into Approach picture plus fields because there are too many
files.

Could I use IBM DB2 tables to store my jpeg files and open up each one
directly within Approach on a form that includes all relating data and
numeric fields pertaining to each image?

If so, how easy is it to import the jpeg files from a directory siting on
our NT server into DB2 tables?  Could it be done on mass or must each image
be imported individually?

DJ
www.christian-bernard.com



Fri, 11 Oct 2002 03:00:00 GMT
 Like to buy DB2 but have concerns..

You may want to evaluate datalinks functionality in db2.

DataLinks enable DB2 databases to manage content that is stored in
external file systems. Read more about it on the IBM website
(http://www.ibm.com/software/data/db2) or ask your friendly IBM
salesperson. An older whitepaper on datalinks is at
http://www-4.ibm.com/software/data/pubs/papers/datalink.html

Quote:
Daniel Jenson writes:

DJ> I am considering purchasing DB2 but I have several questions I need answered
DJ> first...

DJ> I have several applications written in Approach Release 9 which I would like
DJ> to view jpeg images from within Approach.  I do not want to cut and paste
DJ> each image into Approach picture plus fields because there are too many
DJ> files.

DJ> Could I use IBM DB2 tables to store my jpeg files and open up each one
DJ> directly within Approach on a form that includes all relating data and
DJ> numeric fields pertaining to each image?

DJ> If so, how easy is it to import the jpeg files from a directory siting on
DJ> our NT server into DB2 tables?  Could it be done on mass or must each image
DJ> be imported individually?

DJ> DJ
DJ> www.christian-bernard.com

--

Regards,
--
Haider

Disclaimer: I don't speak for IBM.
Note: To reply, remove no_uce from my email address



Fri, 11 Oct 2002 03:00:00 GMT
 Like to buy DB2 but have concerns..
Loading image data from file to database is very easy. I ever write a
program and you can modify it for your purpose. How I did is like this:
1. prepare a file containing all the image file names you want to load
2. run the program against the file

#include <stdio.h>
#include <stdlib.h>
#include <sql.h>
#include "util.h"

EXEC SQL INCLUDE SQLCA;

#define CHECKERR(CE_STR) check_error(CE_STR, &sqlca);

EXEC SQL BEGIN DECLARE SECTION;
long image_index;
char filename[80];
char oldfilename[80];
SQL TYPE is BLOB_FILE b_image_jpeg;
SQL TYPE is BLOB_FILE b_image_thumb;
EXEC SQL END DECLARE SECTION;

int main(int argc, char * argv[])
{
  char *pfileholder, pspace_pos;
  FILE *pfholder;
  int len, pos, tempi;

 if(argc!=2){
   printf("Usage: batchinput file-holder-name\n");
   exit(-1);
 }
 pfileholder=argv[1];
 if((pfholder=fopen(pfileholder, "r"))==NULL){
   printf("Error in opening file %s\n", pfileholder);
   exit(-1);
 }
 EXEC SQL CONNECT TO YOURDB;
 image_index=0;
 while(fgets(oldfilename, sizeof(oldfilename), pfholder)!=NULL){
   tempi=0;
   while(tempi<sizeof(oldfilename)){
      if((oldfilename[tempi]==' ')||(oldfilename[tempi]=='\n'))break;
      filename[tempi]=oldfilename[tempi];
      tempi=tempi+1;
   }
   filename[tempi]='\0';
   printf("reading: %s.", filename);

   /* Doing image data loading */
     memset((void *)b_image_jpeg.name, sizeof(b_image_jpeg.name), '\0');
     strcpy(b_image_jpeg.name, "/home/facerec/images/jpeg/");
     strcat(b_image_jpeg.name, filename);
     strcat(b_image_jpeg.name, ".jpg");
     b_image_jpeg.name_length=strlen(b_image_jpeg.name);
     b_image_jpeg.file_options=SQL_FILE_READ;
     image_index++;
     EXEC SQL insert into imagedata(image_index, image_jpeg)
values(:image_index, :b_image_jpeg);
     if(SQLCODE==0)EXEC SQL commit;
     else EXEC SQL rollback;

   /* loading the next file name */
   memset((void *)filename, sizeof(filename), '\0');
   memset((void *)oldfilename, sizeof(oldfilename), '\0');
 }
 EXEC SQL CONNECT RESET;
 fclose(pfholder);

Quote:
}



Quote:
> I am considering purchasing DB2 but I have several questions I need
answered
> first...

> I have several applications written in Approach Release 9 which I
would like
> to view jpeg images from within Approach.  I do not want to cut and
paste
> each image into Approach picture plus fields because there are too
many
> files.

> Could I use IBM DB2 tables to store my jpeg files and open up each one
> directly within Approach on a form that includes all relating data and
> numeric fields pertaining to each image?

> If so, how easy is it to import the jpeg files from a directory siting
on
> our NT server into DB2 tables?  Could it be done on mass or must each
image
> be imported individually?

> DJ
> www.christian-bernard.com

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 12 Oct 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. DB2 Universal Database Documentation Concerns/Suggestions

2. Having problem to install DB2 Personal Developer Edition - Help

3. DB2 5.2 on solaris having peculiar problem

4. New to DB2, having buffer pool problems

5. Yes, MS Access having problems with DB2 Time datatype #delete

6. Buying and not buying customers...

7. to buy SQL or not to buy?

8. JServer : to buy or not to buy?

9. Informix Being Bought Buy Microsoft? not again

10. Informix Being Bought Buy Microsoft?

11. Having "HAVING" problems with GROUP BY.


 
Powered by phpBB® Forum Software