Inserting records in a table with VARCHAR(4096)

Viswanathan N

Inserting records in a table with VARCHAR(4096)
Hi!!

I have a problem while inserting records in a table which contains
fields of varchar(4096) . It gives the input is too long. Where as the
length of the input is just 300 to 400 chars. What can be the solution ??

regards
Vishy



Roger Miller

Re: Inserting records in a table with VARCHAR(4096)
(in response to Viswanathan N)
I don't have enough information for anything but a guess or two.

guess 1) You are inserting with literals "this is a short string"
The limit for a literal text string is 255. Use host variables
instead of literals.
With V6, you can concatenate multiple strings for this.

guess 2) VARCHAR(4096) and the other columns don't fit into a 4K page.
You will need an 8K, 16K or 32K page.

Roger Miller


Viswanathan N <[login to unmask email]>@RYCI.COM> on 01/06/2000
03:16:27 AM

Please respond to DB2 Data Base Discussion List <[login to unmask email]>

Sent by: DB2 Data Base Discussion List <[login to unmask email]>


To: [login to unmask email]
cc:
Subject: Inserting records in a table with VARCHAR(4096)



Hi!!

I have a problem while inserting records in a table which contains
fields of varchar(4096) . It gives the input is too long. Where as the
length of the input is just 300 to 400 chars. What can be the solution ??

regards
Vishy








Sally Mir

Re: Inserting records in a table with VARCHAR(4096)
(in response to Roger Miller)
My guess would be that you're not initializing the length field for the VARCHAR column.... Be sure to set it to the value of the length of your string.

Sally Mir

Roger Miller wrote:

> I don't have enough information for anything but a guess or two.
>
> guess 1) You are inserting with literals "this is a short string"
> The limit for a literal text string is 255. Use host variables
> instead of literals.
> With V6, you can concatenate multiple strings for this.
>
> guess 2) VARCHAR(4096) and the other columns don't fit into a 4K page.
> You will need an 8K, 16K or 32K page.
>
> Roger Miller
>
> Viswanathan N <[login to unmask email]>@RYCI.COM> on 01/06/2000
> 03:16:27 AM
>
> Please respond to DB2 Data Base Discussion List <[login to unmask email]>
>
> Sent by: DB2 Data Base Discussion List <[login to unmask email]>
>
> To: [login to unmask email]
> cc:
> Subject: Inserting records in a table with VARCHAR(4096)
>
> Hi!!
>
> I have a problem while inserting records in a table which contains
> fields of varchar(4096) . It gives the input is too long. Where as the
> length of the input is just 300 to 400 chars. What can be the solution ??
>
> regards
> Vishy
>
>
>
>
>
>
>
>



Viswanathan N

Re: Inserting records in a table with VARCHAR(4096)
(in response to Sally Mir)
I am actually trying to insert the same from Net.Data . See if it is thru
cobol then there is no problem at all and I have host variables thru which
I can insert. But thru Net.Data I have to pass them as host variables. And
here I have to use Parameter markers "?" to pass the data . Now how to do
this . this is my question . I have cornered the problem till here.

regards
Vishy