Re: writing a blob into database (informix 7.3)
Posted in 2010
Topics: Installation, Setup & Upgrades, Storage & Space Management
On 5/14/10 12:45 AM, emrefan wrote:
> We have Informix 7.3 here and for various reasons we will be stuck
> with it for a while. I need to write some graphical objects into a
> database table and I was just assessing the feasibility but failed at
> the first hurdle<sigh>. I created the simplest of tables, like this
> one below:
>
> create table tt_pics (
> id char(10),
> pic byte in blobspace
> )>
> I then tried two ways of putting things into this table:
>
> Method 1: using the LOAD command
>
> The manual was very terse about loading stuff into a table with a byte
> column. So I just took a shoot in the dark and hoped things would go
> right.
>
> I created a text file with the following content,
>
> somebody|aabbccddee|
>
> That 2nd column's value was just some bytes' values in 2-char hex
> number form.
>
> I then tried loading this text file into the table with an SQL command
> like this:
>
> load from 'the-text-file.txt' insert into tt_pics>
> Needless to say, I got an error message:
>
> -------------------------------------------
> 603: Cannot close blob.>
> 847: Error in load file line 1.
> Error in line 18> Near character position 22
> --------------------------------------------
That's a weird error. The load file you showed should have worked fine.
I was doing some blob work last week - using SQLCMD rather than
DB-Access - but I'm 99.5% sure it would have worked OK in DB-Access too.
The one difference was I was using BYTE {IN TABLE}; can you try that
temporarily? That will help isolate the issue.
You said Informix 7.3; did you mean 7.30.UC1 or 7.31.UD9? There's about
a decade between the releases. You've left it a bit late if you are
using a 7.30 or 7.31.UCx version to upgrade, but...
> So, no go there. Let's talk about method 2.
>
> Method 2:
> [...snip...]
> There, I am now stuck. Can anybody give me a hand?
-=JL=-
On 5月16日, 下午1時54分, Jonathan Leffler <jleff...@earthlink.net> wrote:
> On 5/14/10 12:45 AM, emrefan wrote:
>
>
>
>
>
> > We have Informix 7.3 here and for various reasons we will be stuck
> > with it for a while. I need to write some graphical objects into a
> > database table and I was just assessing the feasibility but failed at
> > the first hurdle<sigh>. I created the simplest of tables, like this
> > one below:
>
> > create table tt_pics (
> > id char(10),> > pic byte in blobspace
> > )
>
> > I then tried two ways of putting things into this table:
>
> > Method 1: using the LOAD command
>
> > The manual was very terse about loading stuff into a table with a byte
> > column. So I just took a shoot in the dark and hoped things would go
> > right.
>
> > I created a text file with the following content,
>
> > somebody|aabbccddee|
>
> > That 2nd column's value was just some bytes' values in 2-char hex
> > number form.
>
> > I then tried loading this text file into the table with an SQL command
> > like this:
>
> > load from 'the-text-file.txt' insert into tt_pics>
> > Needless to say, I got an error message:
>
> > -------------------------------------------
> > 603: Cannot close blob.>
> > 847: Error in load file line 1.
> > Error in line 18> > Near character position 22
> > --------------------------------------------
>
> That's a weird error. The load file you showed should have worked fine.
> I was doing some blob work last week - using SQLCMD rather than
> DB-Access - but I'm 99.5% sure it would have worked OK in DB-Access too.
> The one difference was I was using BYTE {IN TABLE}; can you try that
> temporarily? That will help isolate the issue.
I think the fact I was using "in bolbspace" caused the error. After I
ran "onmode -l; onmode -c" as suggested by some nice guy here, all was
fine. And I just tried it out, with "in table", there was no such
error.
> You said Informix 7.3; did you mean 7.30.UC1 or 7.31.UD9? There's about
> a decade between the releases. You've left it a bit late if you are
> using a 7.30 or 7.31.UCx version to upgrade, but...
We have Informix 7.30 UC6.