Using BLOB in Informix 7.31
Posted in 2008
Ron, on IDS 7.31 under UNIX, wanted to embed JPG/PDF signature images into letters produced by an Informix 4GL report and asked how to use BLOBs. Respondents pointed him to BYTE/TEXT (simple large object) columns, the ESQL/C Programmer's Manual chapters on simple and smart large objects, sample code under $INFORMIXDIR, Art Kagel's utils2_ak tools in the IIUG repository, the "4GL by Example" manual's TEXT/BYTE chapter, and advised storing large objects in a separate blobspace. Ron posted a draft design but still could not work out how to load the image files into the table, and no working solution is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Dear all, I would like to tell you that I am using Informix 7.31 (Text based). I want to place few image files (PDF and/or JPG format) on a report writing by Informix. I hear that I need to use BLOB and I never use BLOB before. Could you tell me how to use BLOB? Any procedures or examples that can support me, please? It seems so complex for me such a beginner! Thank you very much! Cheers Ron
NRON NRON wrote: > Dear all, > > I would like to tell you that I am using Informix 7.31 (Text based). > > I want to place few image files (PDF and/or JPG format) on a report writing by > Informix. I hear that I need to use BLOB and I never use BLOB before. > There are example code files in the samples subdirectory of $INFORMIXDIR if you have the Informix SDK installed. Look there. You can also look at my package utils2_ak in the IIUG Software Repository. Several of the utilities have to deal with simple large objects (SLOBS like BLOB and TEXT columns). Myschema, dbcopy, and ul are such. Art S. Kagel > Could you tell me how to use BLOB? Any procedures or examples that can support > me, please? It seems so complex for me such a beginner! > > Thank you very much! > > Cheers > Ron > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > See you at the IIUG Informix 2008 Conference > The Power Conference for Informix Professionals > April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas > http://www.iiug.org/conf > Registration Now Open!! > >
NRON NRON wrote: > Dear all, > > I would like to tell you that I am using Informix 7.31 (Text based). > > I want to place few image files (PDF and/or JPG format) on a report writing by > Informix. I hear that I need to use BLOB and I never use BLOB before. > > Could you tell me how to use BLOB? Any procedures or examples that can support > me, please? It seems so complex for me such a beginner! > > Thank you very much! > > Cheers > Ron > Have a look in the ESQL/C Programmer's manual (see http://www-306.ibm.com/software/data/informix/pubs/library/csdk_30.html ) Chapter 7 Working With Simple Large Objects Chapter 8 Working With Smart Large Objects Simple binary objects (column type 'byte' and 'text') are easier to handle but you are limited to what you can do with them in the SQL layer. All logic that requires maipulation of the binary objects needs be done in the application code , smart large objects allow you to manipulate parts of the object in SQL . See comparision at beginning of chapter 7. Rgds
Ron, It is not that complex to work with blob columns. Any programming language you use has examples for the use of blob/byte columns. Normally, the API is a little more complex as "normal" sql, but the API contains functions to save/retrieve blob data from/into files or byte arrays typically. To create a blob column, just change the type to blob or byte. If you are planning to store huge amounts of records with blob data, you should place the blob/byte column in a separate Blobspace (which is more effective for storing unformatted data). If you give us the info what language you are implementing in, examples should be easy to find. Marcus -----Original Message----- From: NRON NRON [mailto:nron60@yahoo.com.hk] Sent: Thursday, January 03, 2008 10:29 AM To: ids@iiug.org Subject: Using BLOB in Informix 7.31 [10836] Dear all, I would like to tell you that I am using Informix 7.31 (Text based). I want to place few image files (PDF and/or JPG format) on a report writing by Informix. I hear that I need to use BLOB and I never use BLOB before. Could you tell me how to use BLOB? Any procedures or examples that can support me, please? It seems so complex for me such a beginner! Thank you very much! Cheers Ron ************************************************************************ ******* Forum Note: Use "Reply" to post a response in the discussion forum. See you at the IIUG Informix 2008 Conference The Power Conference for Informix Professionals April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas http://www.iiug.org/conf Registration Now Open!!
Hi there, Do you confirm if your information is working on Informix Version 7.31 in UNIX platform? It seems doesn't work. I still don't understand how to do it after reading the manual... Thank you very much! Regards Ron
Hi Marcus, I am only using Informix (Version 7.31 that it is very old.)in UNIX platform. I have a endorsement letter writing by Informix 4GL. I am preparing some signature files (JPG or PDF format) and want to add on the report for authorized signatory, and then print it. IBM says the the Informix version 7.31 can use BLOB for the propose, but they only give me some general staff. I did find some information by myself, but they are not helpful. I would like to have some practical examples and clear steps how to do it. Could you help me, please? Thank you very much! Regards Ron
Hi, IDS 7.31 supports byte columns, as far as I remember. The API has not changed for this kind of fields and you should be able to use a new SDK/JDBC/ODBC etc. driver to contact the 7.31 instance. Also, the setup in a separate DBSpace is supported and recommended (in case you make massive use of byte content). Marcus -----Original Message----- From: NRON NRON [mailto:nron60@yahoo.com.hk] Sent: Friday, January 04, 2008 9:54 AM To: ids@iiug.org Subject: Re: Using BLOB in Informix 7.31 [10840] Hi there, Do you confirm if your information is working on Informix Version 7.31 in UNIX platform? It seems doesn't work. I still don't understand how to do it after reading the manual... Thank you very much! Regards Ron ************************************************************************ ******* Forum Note: Use "Reply" to post a response in the discussion forum. See you at the IIUG Informix 2008 Conference The Power Conference for Informix Professionals April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas http://www.iiug.org/conf Registration Now Open!!
Hi there, You have many packages regarding utils2_ak in the IIUG Software Repository. Do you have the link path? Does it work for the Informix version 7.31?? Thank you very much! Regards Ron
Hi Ron, Maybe somebody else can help you with 4GL, which I did never use in the past. Sorry about that. My experience is more with ESQL/C and Java and of course the capabilities of IDS. Regards, Marcus -----Original Message----- From: NRON NRON [mailto:nron60@yahoo.com.hk] Sent: Friday, January 04, 2008 10:08 AM To: ids@iiug.org Subject: Re: RE: Using BLOB in Informix 7.31 [10841] Hi Marcus, I am only using Informix (Version 7.31 that it is very old.)in UNIX platform. I have a endorsement letter writing by Informix 4GL. I am preparing some signature files (JPG or PDF format) and want to add on the report for authorized signatory, and then print it. IBM says the the Informix version 7.31 can use BLOB for the propose, but they only give me some general staff. I did find some information by myself, but they are not helpful. I would like to have some practical examples and clear steps how to do it. Could you help me, please? Thank you very much! Regards Ron ************************************************************************ ******* Forum Note: Use "Reply" to post a response in the discussion forum. See you at the IIUG Informix 2008 Conference The Power Conference for Informix Professionals April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas http://www.iiug.org/conf Registration Now Open!!
NRON NRON wrote: > Hi there, > > Do you confirm if your information is working on Informix Version 7.31 in UNIX > platform? It seems doesn't work. I still don't understand how to do it after > reading the manual... Thank you very much! > If you don't include the original reply in your reply noone knows which posting you are replying to. Not everyone uses a news viewer to see the threading. Many of us are using the email gateway. Please include the post you are replying to in your replies. Art S. Kagel Oninit > Regards > Ron > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > See you at the IIUG Informix 2008 Conference > The Power Conference for Informix Professionals > April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas > http://www.iiug.org/conf > Registration Now Open!! > >
Hi If you want tyo learn to use TEXT and BYTE data using 4GL, take a look at the manual 4GL By example: http://publib.boulder.ibm.com/epubs/pdf/5451a.pdf At chapter "Using Text and varchar datatypes". It explains the usage of TEXT but BYTE is the same regards NRON NRON wrote: > Hi Marcus, > > I am only using Informix (Version 7.31 that it is very old.)in UNIX platform. > > I have a endorsement letter writing by Informix 4GL. I am preparing some > signature files (JPG or PDF format) and want to add on the report for > authorized signatory, and then print it. > > IBM says the the Informix version 7.31 can use BLOB for the propose, but they > only give me some general staff. I did find some information by myself, but > they are not helpful. > > I would like to have some practical examples and clear steps how to do it. > Could you help me, please? Thank you very much! > > Regards > Ron > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > See you at the IIUG Informix 2008 Conference > The Power Conference for Informix Professionals > April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas > http://www.iiug.org/conf > Registration Now Open!! > > >
>Dear all,
>I would like to tell you that I am using Informix 7.31 (Text based).
>I want to place few image files (PDF and/or JPG format) on a report writing
by >Informix. I hear that I need to use BLOB and I never use BLOB before.
>Could you tell me how to use BLOB? Any procedures or examples that can
support >me, please? It seems so complex for me such a beginner!
>Thank you very much!
>Cheers
>Ron
----------------------------------------------------------------------------
I did make the study case shown as the following.
Background
In function Renewal Endorsement & Renewal Endorsement Letter, we need to sign
name on each letter that is not efficiency
Therefore, the functions need to print the digital signature on those letters
automatically.
Enhancement
(1) Prepare a digital signature files
In PC (Copy signature files from PC to UNIX server):
FTP transfer:
 ftp <unix_server_name>(Input login name and password)
 cd /data/grp/tmp/transfer
 put datefile1.jpg
 put datefile2.jpg
 bye
(2) Create a table signature with a field of BLOB type
CREATE TABLE signature
(
id_num INT,
sign_name BYTE
);
(3) Add records to table signature
I don't know how to insert from JPG files to the table above...
(4) Call the table signature and place the BLOB field to the report
template
In function Renewal Endorsement (A Informix 4GL program):
define f_sign_name1 byte,
f_sign_name2 byte
.
.
select sign_name into f_sign_name1
from signature
where id_num = 1
select sign_name into f_sign_name2
from signature
where id_num = 2
.
.
print column 1, "VP, Head of Group and Pensions";
print column 63, "VP & Appointed Actuary"
skip 1 line
print column 1, f_sign_name1;
print column 63, f_sign_name2
In function Renewal Endorsement Letter A Informix 4GL program):
define f_sign_name1 byte,
f_sign_name2 byte
.
.
select sign_name into f_sign_name1
from signature
where id_num = 1
select sign_name into f_sign_name2
from signature
where id_num = 2
.
.
print column 1, "VP, Head of Group and Pensions";
print column 43, "VP & Appointed Actuary"
skip 1 line
print column 1, f_sign_name1;
print column 43, f_sign_name2
----------------------------------------------------------------------------
Hi all,
DoI miss something on my study case? Also, I don't know how insert those image
files to the table. Does anyone help me, please? Thank you so much!
Best Regards
Ron