How to insert String more than 256Bytes to Database???
Posted in 2000
Topics: General Discussion
I began to use Informix Dynamic Server 7.24 these days. I found that we can define a char type maximum to 32576 bytes. But a quoted string only allow less than 256 bytes. Then how should I insert,update a String more than 256 bytes to DB? Any easy way? Please help me!!! Thank you Sent via Deja.com http://www.deja.com/ Before you buy.
Use a tool other than dbaccess to import the data. 4GL, ESQL/C, CLI,
DBD/DBI Informix for Perl any of these will let you write applications that
can insert longer strings into CHAR type columns.
Art S. Kagel
minboy@my-deja.com wrote:
>
> I began to use Informix Dynamic Server 7.24 these
> days.
> I found that we can define a char type maximum to
> 32576 bytes. But a quoted string only allow less
> than 256 bytes. Then how should I insert,update a
> String more than 256 bytes to DB?
> Any easy way?
> Please help me!!!
> Thank you
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Forgot to mention using dbload and/or Jonathan Leffler's sqlcmd package.
Art S. Kagel
minboy@my-deja.com wrote:
>
> I began to use Informix Dynamic Server 7.24 these
> days.
> I found that we can define a char type maximum to
> 32576 bytes. But a quoted string only allow less
> than 256 bytes. Then how should I insert,update a
> String more than 256 bytes to DB?
> Any easy way?
> Please help me!!!
> Thank you
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
minboy@my-deja.com wrote:
> Then how should I insert,update a
> String more than 256 bytes to DB?
CREATE TABLE long_string (
id INTEGER PRIMARY KEY,
ls CHAR( 32000 )
);
INSERT INTO long_string VALUES ( 1, 'First part of the long string' );
UPDATE long_string SET ls = ls || 'Second part of the long string' WHEREid =1;
...
UPADTE long_string SET ls = ls || 'Last part of the long string' WHERE
id = 1;