Re: Blob size from SQL
Posted in 2011
A user wanted to find zero-length BLOB values via SQL (e.g. LENGTH(blob)=0) but got error -674 "Routine (length) can not be resolved"; SIZE() failed too. IBM tech support confirmed there is no built-in way to get a smart-large-object's size from SQL, and a feature request already exists for extending LENGTH() to BLOB/CLOB. As a workaround, Fernando Nunes pointed to an earlier IIUG thread and a developerWorks article describing a DataBlade/UDR that returns smart blob length; the poster was compiling it (needing gcc) but didn't report final success. Note that an IS NULL test doesn't help, since the handle exists while the blob itself is empty.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Data Types & Schema Design
If you consider a definitive answer the development of the feature I believe
you're right...
In any case please check this earlier thread:
http://www.iiug.org/forums/ids/index.cgi/read/19143
and this article:
http://www.ibm.com/developerworks/data/zones/informix/library/techarticle/db_sblob.html
I think it will solve your problem...
In any case I think we all agree that length(blob) would be better... It's
just a question of priorities... Please ask for the feature in your PMR even
if this answer solves your problem.
As some important person once told me: "we will not implement things that
are not asked for... unless we had nothing more to do, which obviously is
not the case".
The words were not exactly these, I don't remember who is was, but I must
agree it makes sense. So, asking for things is a requirement for future
complaints :)
Regards.
On Tue, Mar 1, 2011 at 12:06 AM, pretzel <davidegrove@gmail.com> wrote:
> On Feb 28, 1:23 pm, Art Kagel <art.ka...@gmail.com> wrote:
> > IB that you can use the LENGTH() function with a BLOB/CLOB type column, I
> > know you can use it with a TEXT/DATA type column.
> >
> > Art
> >
> > Art S. Kagel
> > Advanced DataTools (www.advancedatatools.com)
> > IIUG Board of Directors (a...@iiug.org)
> > Blog:http://informix-myview.blogspot.com/
> >
>
> Thank you, Art. I always appreciate your posts.
>
> I tried the following in dbaccess:
>
> "SELECT <row_pk_ FROM <table> WHERE LENGTH(blob)=0;"
>
> and got:
>
> "674: Routine (length) can not be resolved."
>
>
> Same thing when trying SIZE().
>
> I see that this has been asked a couple of times in the past 10 years,
> with no definitive answer, so I suspect Informix does not provide the
> capability. Just to be sure, I have opened a tech support case to get
> the real skinny.
>
> Thank you.
>
> DG
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--> As some important person once told me: "we will not implement
things that
--> are not asked for... unless we had nothing more to do, which
obviously is
--> not the case".
obstacle has it... and you can tell that fellow that it is more or
less the same discussion as having upper in 9.1 and pre 7.3
Superboer
On 1 mrt, 12:51, Fernando Nunes <domusonl...@gmail.com> wrote:
> If you consider a definitive answer the development of the feature I believe
> you're right...
> In any case please check this earlier thread:
>
> http://www.iiug.org/forums/ids/index.cgi/read/19143
>
> and this article:
>
> http://www.ibm.com/developerworks/data/zones/informix/library/techart...
>
> I think it will solve your problem...
> In any case I think we all agree that length(blob) would be better... It's
> just a question of priorities... Please ask for the feature in your PMR even
> if this answer solves your problem.
> As some important person once told me: "we will not implement things that
> are not asked for... unless we had nothing more to do, which obviously is
> not the case".
> The words were not exactly these, I don't remember who is was, but I must
> agree it makes sense. So, asking for things is a requirement for future
> complaints :)
>
> Regards.
>
>
>
> On Tue, Mar 1, 2011 at 12:06 AM, pretzel <davidegr...@gmail.com> wrote:
> > On Feb 28, 1:23 pm, Art Kagel <art.ka...@gmail.com> wrote:
> > > IB that you can use the LENGTH() function with a BLOB/CLOB type column, I
> > > know you can use it with a TEXT/DATA type column.
>
> > > Art
>
> > > Art S. Kagel
> > > Advanced DataTools (www.advancedatatools.com)
> > > IIUG Board of Directors (a...@iiug.org)
> > > Blog:http://informix-myview.blogspot.com/
>
> > Thank you, Art. I always appreciate your posts.
>
> > I tried the following in dbaccess:
>
> > "SELECT <row_pk_ FROM <table> WHERE LENGTH(blob)=0;"
>
> > and got:
>
> > "674: Routine (length) can not be resolved."
>
> > Same thing when trying SIZE().
>
> > I see that this has been asked a couple of times in the past 10 years,
> > with no definitive answer, so I suspect Informix does not provide the
> > capability. Just to be sure, I have opened a tech support case to get
> > the real skinny.
>
> > Thank you.
>
> > DG
> > _______________________________________________
> > Informix-list mailing list
> > Informix-l...@iiug.org
> >http://www.iiug.org/mailman/listinfo/informix-list
>
> --
> Fernando Nunes
> Portugal
>
> http://informix-technology.blogspot.com
> My email works... but I don't check it frequently...
This is a side discussion and I personally could agree with you but:
- The idea that person gave to me, was kind of generic, and in no way
related to this
- The facts are that IBM has a number of documented requests. And there are
several non documented. The people who has to prioritize the features
implementation must evaluate them under certain criteria.
These criteria will never be consensual, but that's a fact of life. Point
is: Please document the requests. After that it's easier to complain :)
Regards.
On Tue, Mar 1, 2011 at 1:37 PM, Superboer <superboer7@t-online.de> wrote:
> --> As some important person once told me: "we will not implement
> things that
> --> are not asked for... unless we had nothing more to do, which
> obviously is
> --> not the case".
>
> obstacle has it... and you can tell that fellow that it is more or
> less the same discussion as having upper in 9.1 and pre 7.3
>
> Superboer
>
> On 1 mrt, 12:51, Fernando Nunes <domusonl...@gmail.com> wrote:
> > If you consider a definitive answer the development of the feature I
> believe
> > you're right...
> > In any case please check this earlier thread:
> >
> > http://www.iiug.org/forums/ids/index.cgi/read/19143
> >
> > and this article:
> >
> > http://www.ibm.com/developerworks/data/zones/informix/library/techart...
> >
> > I think it will solve your problem...
> > In any case I think we all agree that length(blob) would be better...
> It's
> > just a question of priorities... Please ask for the feature in your PMR
> even
> > if this answer solves your problem.
> > As some important person once told me: "we will not implement things that
> > are not asked for... unless we had nothing more to do, which obviously is
> > not the case".
> > The words were not exactly these, I don't remember who is was, but I must
> > agree it makes sense. So, asking for things is a requirement for future
> > complaints :)
> >
> > Regards.
> >
> >
> >
> > On Tue, Mar 1, 2011 at 12:06 AM, pretzel <davidegr...@gmail.com> wrote:
> > > On Feb 28, 1:23 pm, Art Kagel <art.ka...@gmail.com> wrote:
> > > > IB that you can use the LENGTH() function with a BLOB/CLOB type
> column, I
> > > > know you can use it with a TEXT/DATA type column.
> >
> > > > Art
> >
> > > > Art S. Kagel
> > > > Advanced DataTools (www.advancedatatools.com)
> > > > IIUG Board of Directors (a...@iiug.org)
> > > > Blog:http://informix-myview.blogspot.com/
> >
> > > Thank you, Art. I always appreciate your posts.
> >
> > > I tried the following in dbaccess:
> >
> > > "SELECT <row_pk_ FROM <table> WHERE LENGTH(blob)=0;"
> >
> > > and got:
> >
> > > "674: Routine (length) can not be resolved."
> >
> > > Same thing when trying SIZE().
> >
> > > I see that this has been asked a couple of times in the past 10 years,
> > > with no definitive answer, so I suspect Informix does not provide the
> > > capability. Just to be sure, I have opened a tech support case to get
> > > the real skinny.
> >
> > > Thank you.
> >
> > > DG
> > > _______________________________________________
> > > Informix-list mailing list
> > > Informix-l...@iiug.org
> > >http://www.iiug.org/mailman/listinfo/informix-list
> >
> > --
> > Fernando Nunes
> > Portugal
> >
> > http://informix-technology.blogspot.com
> > My email works... but I don't check it frequently...
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
As expected, tech support confirms the inability of Informix to learn the size of a blob from SQL. The thing that surprised me, though, was that we went back-and-forth a few times trying stuff. This issue seems like something tech support should have just immediately known, without me having to try stuff and report back. I did make a request for enhancement. But, after 10 years of these kinds of questions (searching cdi), I gotta think IDS developers have long decided to disregard the issue. DG
Meanwhile, did you try the information I posted? It helped the person asking for this at the time... Also, I think I'm missing something... You're looking for blob length()= 0, but you mentioned that SELECT ... FROM table WHERE blob_column IS NULL will not solve the problem. At this moment I cannot see why? Regards. On Tue, Mar 1, 2011 at 10:54 PM, pretzel <davidegrove@gmail.com> wrote: > As expected, tech support confirms the inability of Informix to learn > the size of a blob from SQL. > > The thing that surprised me, though, was that we went back-and-forth a > few times trying stuff. This issue seems like something tech support > should have just immediately known, without me having to try stuff and > report back. > > I did make a request for enhancement. But, after 10 years of these > kinds of questions (searching cdi), I gotta think IDS developers have > long decided to disregard the issue. > > DG > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently...
>On Mar 1, 2:29 pm, Fernando Nunes <domusonl...@gmail.com> wrote: > Meanwhile, did you try the information I posted? It helped the person asking > for this at the time... Thank you, Mr. Nunes. I am in process of implementing it. I tried it VERY quick and dirty, by attempting to use the precompiled blade, but didn't work. I'm thinking, based on the error message (couldn't find a library file) that it may be due to a dependency on a library object from the Sun C compiler, which we don't have. So, now, I'm taking the more scenic route and getting gcc (which wasn't on this machine), and recompiling, etc. > Also, I think I'm missing something... You're looking for blob length()= 0, > but you mentioned that SELECT ... FROM table WHERE blob_column IS NULL will > not solve the problem. > At this moment I cannot see why? I don't represent myself as an expert, so could be totally full of beans. But, my hunch is that the blob column isn't empty, but, in fact, has a proper blob handle (meaning, it is properly not NULL). It's just that the blob to which the handle points has zero length. I'm guessing that it could have gotten that way by execution of an SQL "INSERT filetolo(<filename>... ) ..." with an empty file supplied as the argument. Anyway, I'm going to try the blade. Thank you, once again. DG
Got this from tech support: "I was following up on your request to extend the LENGTH() functionality to BLOBs and CLOBs, but is so happens that there is one Feature Request for that matter already, and we hope to see that implemented in future releases" DG