Re: Text column copy across tables



Manish <manish.minni.m@xxxxxxxxx> wrote:
Hi

I have two tables with text columns. I wish to update text column in
existing rows in TABLE1 using data present in the text column of a
corresponding row in TABLE2.
(The row in TABLE2 can be selected without referring to the text
column values)

Sybase ver is 12.5.3

BTW, I have read some of writetext & readtext in the manual, but it
seems very complex, and if I have to use it, can someone give me a
small example.

You can use a normal update statement.

I tried :

(22) create table t(i int, t text)
(23) create table s(i int, t text)
(24) insert t values (1, 'abc')
(25) insert s values (1, 'efg')
(26) update t set t.t = s.t from t, s where t.i = s.i
(27) select * from t

Don't forget to set textsize if datalength of the textfield
is larger dan 32768.

Luc.

.



Relevant Pages

  • Re: SQL Comparison of ISNULL values
    ... Can you show the exact results you want? ... ID INT, ... INSERT table1 SELECT 2, NULL ... INSERT table2 SELECT 3, NULL ...
    (microsoft.public.sqlserver.programming)
  • Re: Text column copy across tables
    ... corresponding row in TABLE2. ... You can use a normal update statement. ... create table t(i int, t text) ... Don't forget to set textsize if datalength of the textfield ...
    (comp.databases.sybase)
  • Re: Importing xml through tsql
    ... declare @h int ... --insert into table1 ... --insert into table2 ... > I want to upload xml data with sql's openxml. ...
    (microsoft.public.sqlserver.xml)
  • Re: ADP/SQL Data Selection Criteria in a Stored Procedure
    ... create table table1 (Client_Id int, DateEntered datetime, Employee_ID int) ... create table table2 ... > result in SP and return as a report row source in ADP. ...
    (microsoft.public.sqlserver.programming)
  • How to use the WRITETEXT command - newbie question
    ... I am very new to sql server and I am trying to update a ntext field. ... I would like to update the data in table2 with the data in table1 where ...
    (microsoft.public.sqlserver.programming)