Variable Length Character Data > 256 bytes
Posted in 2000
Topics: Connectivity: ODBC / JDBC / .NET, Security, Permissions & Auditing, Data Types & Schema Design
I need to create a column in a informix table that will allow me to store at least 2000 bytes of variable length character data that I can insert a literal into , update and search on the column. I working on an ODBC client application using SQL. A Text datatype will allow me to store the information but will not allow me insert, update or delete using SQL. I can use a char(2000) but then I am using 2000 bytes everytime. I have tried using lvarchar in my SQL create table statement but am getting a syntax error. Any help would be appreciated Grant Hickey North Plains Systems
Is it actually text? If so, I would recommend putting it into a
separate table with a reference from the original table. The new table
would look something like this:
create table text_table (
text_id INT,
sequence INT,
text_field VARCHAR(255)
);
That way you can store each line as a separate record.
Or, you could use 9.2x and use a text datablade, which is probably a
better idea yet.
In article <B5629841.8BE%ghickey@northplains.com>,
Grant Hickey <ghickey@northplains.com> wrote:
> I need to create a column in a informix table that will allow me to
store at
> least 2000 bytes of variable length character data that I can insert a
> literal into , update and search on the column. I working on an ODBC
client
> application using SQL. A Text datatype will allow me to store the
> information but will not allow me insert, update or delete using SQL.
I can
> use a char(2000) but then I am using 2000 bytes everytime. I have
tried
> using lvarchar in my SQL create table statement but am getting a
syntax
> error.
>
> Any help would be appreciated
>
> Grant Hickey
> North Plains Systems
>
>
--
# unrm /
ksh: unrm: not found
# man cpio
Sent via Deja.com http://www.deja.com/
Before you buy.
Grant Hickey wrote:
>
> I need to create a column in a informix table that will allow me to store at
> least 2000 bytes of variable length character data that I can insert a
> literal into , update and search on the column. I working on an ODBC client
> application using SQL. A Text datatype will allow me to store the
> information but will not allow me insert, update or delete using SQL. I can
> use a char(2000) but then I am using 2000 bytes everytime. I have tried
> using lvarchar in my SQL create table statement but am getting a syntax
> error.
You do not state version or platform which usually helps. Type LVARCHAR
is only supported in IDS.2000 (well 9.xx actually) not in IDS v7.xx.
However, I would encourage you to Mars' advice and use a separate table with
one row per line EVEN if you have IDS.2000, but I'd recommend small fixed
length char records for speed and simplicity, the waste is minimal. So I
make the table:
create table header_notes (
integer header_table_key,
smallint note_sequence,
char text(80),
primary key (header_table_key, note_sequence),
foreign key (header_table_key) references header_table
);
Art S. Kagel