Varchars (limit?)
Posted in 2000
Topics: Data Types & Schema Design
Hello all, I remember someone once telling me Informix 9.x has a varchar2(), is this correct? We just got 9.21,UC3-1 (IDS.2000 WE) and I can't seem to find a varchar2. The problem is I have a field that needs to be 400 characters long. I'd like to use a varchar on it but the current limit is 255 characters. I can use a blob which is a pain to use or use a char(400) which wastes a lot of space. Anyone have any ideas of what I can use? Thanks, Richard Krenek
Richard Krenek wrote: > I remember someone once telling me Informix 9.x has a varchar2(), is > this correct? VARCHAR2 is the Oracle name, of course; Informix calls it LVARCHAR (long VARCHAR). > We just got 9.21,UC3-1 (IDS.2000 WE) and I can't seem to > find a varchar2. The problem is I have a field that needs to be 400 > characters long. I'd like to use a varchar on it but the current limit > is 255 characters. I can use a blob which is a pain to use or use a > char(400) which wastes a lot of space. Anyone have any ideas of what I > can use? For only 400 characters, LVARCHAR is fine. The upper limit for storage of a single LVARCHAR is 2 KB. However, when used to talk back and forth, the upper limit is 32 KB. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Hmmm, Everyone seem to say lvarchar but when I try to create a table with that
I get a 201 error. Is this because I have the workgroup edition (we are
cheep!!) or am I being stupid and doing something wrong?
CREATE TABLE a_test (stuff lvarchar(400));
Thanks all,
Rich
Jonathan Leffler wrote:
> Richard Krenek wrote:
>
> > I remember someone once telling me Informix 9.x has a varchar2(), is
> > this correct?
>
> VARCHAR2 is the Oracle name, of course; Informix calls it LVARCHAR (long
> VARCHAR).
>
> > We just got 9.21,UC3-1 (IDS.2000 WE) and I can't seem to
> > find a varchar2. The problem is I have a field that needs to be 400
> > characters long. I'd like to use a varchar on it but the current limit
> > is 255 characters. I can use a blob which is a pain to use or use a
> > char(400) which wastes a lot of space. Anyone have any ideas of what I
> > can use?
>
> For only 400 characters, LVARCHAR is fine. The upper limit for storage of a
> single LVARCHAR is 2 KB. However, when used to talk back and forth, the
> upper limit is 32 KB.
>
> --
> Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
> Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>
Richard Krenek <rkrenek@ihs.com> writes:
> Hmmm, Everyone seem to say lvarchar but when I try to create a table with that
> I get a 201 error. Is this because I have the workgroup edition (we are
> cheep!!) or am I being stupid and doing something wrong?
> CREATE TABLE a_test (stuff lvarchar(400));
And you are trying to set the length on lvarchar because?
Might I reccomend the "Informix Guide to SQL Reference"?
finderr telles you it's a syntax error (201), the manuals tells you
what lvarchar is.
I suppose this works:
CREATE TABLE a_test (stuff LVARCHAR);
Thomas