Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin  HomeHome
SQL400
 AS400,iseries,System i,LANSA,CSS,HTML,Scripts :AS400(Iseries) :SQL400
Message Icon Topic: How to update same data into different column? Post Reply Post New Topic
Author Message
Anil
Newbie
Newbie
Avatar

Joined: 10 Apr 2007
Location: Cote D'Ivoire
Posts: 32
Quote Anil Replybullet Topic: How to update same data into different column?
    Posted: 27 Feb 2010 at 7:08pm

How to update same data into different column inthe same table  having different datatype ?

 
Thanks & Regards,
Anil
IP IP Logged
DB2GURU
Newbie
Newbie
Avatar

Joined: 23 Feb 2010
Location: Japan
Posts: 3
Quote DB2GURU Replybullet Posted: 27 Feb 2010 at 7:10pm

Inserting same data into different column inthe same table  having different datatype.


Here I have used the view of same table to update the coumn with diffent data base. The syantax is for MS SQL server.

username varchar(50)
Custid intger

update table1 set username =  CAST(a.custid as varchar(50)) from view1 a where table1.custid = a.custid

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Bulletin Board Software by Web Wiz Forums version 8.05
Copyright ©2001-2006 Web Wiz Guide