Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

readtext/write text Help Needed

2 posts in Windows NT Last posting was on 2000-04-13 05:06:47.0Z
Joe A Posted on 2000-04-11 18:44:54.0Z
From: "Joe A" <joea@mail.smu.edu>
Subject: readtext/write text Help Needed
Date: Tue, 11 Apr 2000 13:44:54 -0500
Lines: 15
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Message-ID: <XRJ5kb#o$GA.201@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: jantonecchia.psoft.smu.edu 129.119.54.146
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2335
Article PK: 1089768

I am trying to copy the value of a text field from one table and update it
into the text field of another table. Since these are large text blocks I
understand I must usre readtext and writetext to accomplish this. My
problem is the manuals only show using a literal text string in the write
text example:

writetext PS_AV_GIFT_DTL.DESCRLONG @pageptr "Hi Joe!!"

How do I use a variable instead of a literal where the variable is a large
text value?

Thanks
Joe


Bret Halford Posted on 2000-04-13 05:06:47.0Z
Message-ID: <38F555E7.827D486E@sybase.com>
Date: Wed, 12 Apr 2000 23:06:47 -0600
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.5 [en]C-CCK-MCD (WinNT; I)
X-Accept-Language: en,ja
MIME-Version: 1.0
Subject: Re: readtext/write text Help Needed
References: <XRJ5kb#o$GA.201@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 24
NNTP-Posting-Host: bret-pc.sybase.com 157.133.80.211
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2325
Article PK: 1089753


Joe A wrote:

> I am trying to copy the value of a text field from one table and update it
> into the text field of another table. Since these are large text blocks I
> understand I must usre readtext and writetext to accomplish this. My
> problem is the manuals only show using a literal text string in the write
> text example:
>
> writetext PS_AV_GIFT_DTL.DESCRLONG @pageptr "Hi Joe!!"
>
> How do I use a variable instead of a literal where the variable is a large
> text value?

Hi Joe,

You don't. And you don't use READTEXT/WRITETEXT for copying text from
one table to another, you should just use insert (for a new row) or update
(for an existing
row).

INSERT secondtable (textfield) SELECT textfield FROM firsttable WHERE
primarykey = <x>

or

UPDATE secondtable set s.textfield = f.textfield FROM secondtable s,
firsttable f
WHERE s.primarykey = <x> and f.primarykey = <y>


-bret