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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting into memo field

Status
Not open for further replies.

TomBarrand

Programmer
Aug 9, 2000
162
0
0
GB
I am trying to insert data into a table that has memo fields (text datatypes) and I get the error message below. What do I need to do?

Thanks

617: A blob data type must be supplied within this context.Error in line 1
 
Tom:

Blobs in Informix are tricky beasts. Unfortunately, if you're trying to insert into a blob using SQL from dbaccess/isql, that's not going to work.

Without getting into a hugh discussion on BLOB types, I can tell you that the informix SQL command load can be used to populate BLOB text types.

I typically use load and unload to manipulate text types.

Regards,


Ed
Schaefer
 
If I have an sql insert statement like below. What do I need to do to get the data in then?

insert into po_hdr (memo_field) values ('test')

Thanks
 
Tom:

Let's assume you have a table structured thusly:

create table po_hdr {
int_key integer,
description char(25),
memo_field text
}

Place two data rows in a file called x.unl
1|FIRST RECORD|A LINE OF TEXT FOR TESTING|
2|SECOND RECORD|ANOTHER LINE OF TEXT|

FROM query language of dbaccess/isql:

load from x.unl insert into po_hdr

You can also unload data using any valid select:

unload to anotherfile.unl select * from po_hdr

By default, the Informix field delimiter DBDELIMITER is the pipe symbol, |. You can change it to something else such as the ampersand:

export DBDELIMITER=\& # special character must be
# escaped under unix

If you want to modify a blob text "in place", unfortunately, you need an external program written in Informix 4GL, "C", VB, etc. This is probably not what you wanted to hear.

Regards,


Ed
Schaefer
 
Hi,
I am trying to use BLOBS to store zipped (gzip) files.
For loading the file i am using
$INFORMIXDIR/demo/esqlc/blobload.ec.
[ The field used to store it is a BYTE ]
But on retrieving the data it gives HEX code.

I tried loading the data into TEXT field , retrieving of text data works properly, but the retrieved (unloaded ) zip file gets corroupted.

Is there any way to retrieve binary data from BLOB ?

Thanks & Regards
Munish
 
Hello!
I have this structure:
Column name Type Nulls

vct_cvect varchar(6,0) yes
vct_consec serial no
vct_descri Text no
vct_vig_ini date yes
vct_vig_fin date yes
vct_usuari varchar(8,0) yes
vct_fecult date yes
vct_funda text no

I have this SQL statment running on DBACCESS

load from ViolacionesCGT.unl insert into catvioct

This is the first line of the UNL file:

(M2f)|0|texto a cargar|01/01/2000|31/12/2002|0|10/07/2002|Texto a cargar 2

and I get this error message:

846: Number of values in load file is not equal to number of columns.
847: Error in load file line 1.

What is wrong?

I'm using Informix 9.x.
Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top