Copy text field from one row to another???

Copy text field from one row to another???

Post by Jason McBrid » Wed, 22 Nov 2000 04:00:00



I have a table called cust_properties that has two columns

id    integer
dwsyntax    text

I would like to copy the text field from the row where id is 2 to the row
where id is 3.  Does any know the sql statement required to do this???

Thank You,

Jason

 
 
 

Copy text field from one row to another???

Post by Doo » Wed, 22 Nov 2000 04:00:00


There is no "statement" that does that...but here's a SP that will...edit to
suit your environment:


DECLARE TV CURSOR FORWARD_ONLY READ_ONLY FOR
     SELECT ArtistID, TEXTPTR(ArtistBio)
 FROM ArtistsOld
    WHERE ArtistBio IS NOT NULL
OPEN TV


     BEGIN
     IF (SELECT TEXTVALID('Artists.Bio',  TEXTPTR(Bio)) FROM Artists WHERE





     END
CLOSE TV
DEALLOCATE TV

--
Doo
Senior Data Architect / DBA
PlanetJam Media Group


Quote:> I have a table called cust_properties that has two columns

> id    integer
> dwsyntax    text

> I would like to copy the text field from the row where id is 2 to the row
> where id is 3.  Does any know the sql statement required to do this???

> Thank You,

> Jason


 
 
 

Copy text field from one row to another???

Post by Don Arsenaul » Tue, 28 Nov 2000 04:00:00


Just use an INSERT/SELECT statement

INSERT INTO cust_properties (id, dwsyntax)
SELECT 3, dwsyntax
FROM cust_properties
WHERE id = 2

Don.


I have a table called cust_properties that has two columns

id    integer
dwsyntax    text

I would like to copy the text field from the row where id is 2 to the row
where id is 3.  Does any know the sql statement required to do this???

Thank You,

Jason