problem with varchar field 
Author Message
 problem with varchar field

Hi Experts,
I am having a table with a varchar (255).
I am trying to put a string into it by converting it to varchar.

insert into abc(id , sessionid , value )
values (8, '3986c53f000141982749c0a8070405ee',
convert(varchar,'PlanId=1135-1032,
PlanName=Test plan,QtyRange5=,AdjustmentType=1,Price1=10,Status=0,
Price2=20,Price3=,Price4=,Price5=,TieredPricing=1,Mark=0,AdjValue=22,
ClassValue=asd,AdjustmentBase=0,
QtyRange1=10,QtyRange2=20,QtyRange3=,QtyRange4='))

 It just truncates some part of the value randomly & inserts to the
table.Could anyone tell me why it is happening & also the solution for it.

Thanks
Veena



Sat, 18 Jan 2003 03:00:00 GMT
 problem with varchar field

Just make it as

convert( varchar(255), 'PlanId=1135-1032,
 PlanName=Test plan,QtyRange5=,AdjustmentType=1,Price1=10,Status=0,
 Price2=20,Price3=,Price4=,Price5=,TieredPricing=1,Mark=0,AdjValue=22,
 ClassValue=asd,AdjustmentBase=0,
 QtyRange1=10,QtyRange2=20,QtyRange3=,QtyRange4='))

which inserts 255 characters into value field.

Ananthi


Quote:
> Hi Experts,
> I am having a table with a varchar (255).
> I am trying to put a string into it by converting it to varchar.

> insert into abc(id , sessionid , value )
> values (8, '3986c53f000141982749c0a8070405ee',
> convert(varchar,'PlanId=1135-1032,
> PlanName=Test plan,QtyRange5=,AdjustmentType=1,Price1=10,Status=0,
> Price2=20,Price3=,Price4=,Price5=,TieredPricing=1,Mark=0,AdjValue=22,
> ClassValue=asd,AdjustmentBase=0,
> QtyRange1=10,QtyRange2=20,QtyRange3=,QtyRange4='))

>  It just truncates some part of the value randomly & inserts to the
> table.Could anyone tell me why it is happening & also the solution for it.

> Thanks
> Veena



Sat, 18 Jan 2003 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Problem with varchar field

2. Problems casting memo to varchar fields.

3. Problem with reading varchar field.

4. Problems with large text fields (VARCHAR(1500) in Oracle with RDO 2.0

5. Varchar field content check problem

6. urgent problem with update on varchar field

7. A Varchar(1000) field vs 1000 Bit fields

8. Copying data from a TEXT field into two Varchar fields

9. Field Lenght Limitation in SQL 7 varchar field type

10. Using a text field to combine multiple varchar(255) fields

11. Blank field not space in char and varchar field

12. SQL 6.5 - text field to varchar(255) fields


 
Powered by phpBB® Forum Software