READTEXT is a fine function, but useless by itself. I need to return the
results of READTEXT into a varchar column but have been unable to do so or
even find a similar example. Displaying the results in Query Analyzer is all
the example MS provides.
I need something like the following:
Select @.string = READTEXT tblFLC_Catalog.longDescription @.textptr
@.chunkindex @.chunksize
Any suggestions?
MichaelPlease don't start new threads, there is already a thread about this you
started half an hour ago.
"Snake" <Snake@.discussions.microsoft.com> wrote in message
news:DE98D97E-C3CF-44DB-8C13-1747CD3194EF@.microsoft.com...
> In the continuing saga of dealing with blobs . . .
> READTEXT is a fine function, but useless by itself. I need to return the
> results of READTEXT into a varchar column but have been unable to do so or
> even find a similar example. Displaying the results in Query Analyzer is
> all
> the example MS provides.
> I need something like the following:
> Select @.string = READTEXT tblFLC_Catalog.longDescription @.textptr
> @.chunkindex @.chunksize
> Any suggestions?
> Michael|||> READTEXT is a fine function, but useless by itself. I need to return the
> results of READTEXT into a varchar column
I'm not sure I understand this. What exactly are you trying to accomplish
(e.g. forget about READTEXT for a minute, what are you going to actually DO
with each of these chunks)?|||Snake wrote:
> In the continuing saga of dealing with blobs . . .
> READTEXT is a fine function, but useless by itself. I need to return
> the results of READTEXT into a varchar column but have been unable to
> do so or even find a similar example. Displaying the results in Query
> Analyzer is all the example MS provides.
> I need something like the following:
> Select @.string = READTEXT tblFLC_Catalog.longDescription @.textptr
> @.chunkindex @.chunksize
> Any suggestions?
> Michael
How about querying the column directly using a SELECT statement?
Declare @.MyText VARCHAR(1000)
Select
@.MyText = SUBSTRING(pr_info, 1, 100)
From
pubs.dbo.pub_info
Where
pub_id = '0736'
Select @.MyText
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Aaron,
If you really read my orignal posting you will see that while these postings
are related, this one is more specific and focused on how to use the
READTEXT. Since your own responses to each of my postings is different, at
least on some level even you see them differently.
"Aaron Bertrand [SQL Server MVP]" wrote:
> Please don't start new threads, there is already a thread about this you
> started half an hour ago.
>
> "Snake" <Snake@.discussions.microsoft.com> wrote in message
> news:DE98D97E-C3CF-44DB-8C13-1747CD3194EF@.microsoft.com...
>
>|||David,
Thanks for your response. I believe I read in BOL that for ntext columns
over 4000 characters one must use the READTEXT function. My data is longer
than 4000, therefore I must use READTEXT to parse my data and return it to m
y
program in, say, 1k chunks. Is this an incorrect approach?
I am warry of the pubs examples and sample code because they always assume
the most simplistic situations and from my point-of-view ignore much of the
real-world. One must always read the associated text in BOL to find the
gotchas!
Have a very nice 3-day w
"David Gugick" wrote:
> Snake wrote:
> How about querying the column directly using a SELECT statement?
> Declare @.MyText VARCHAR(1000)
> Select
> @.MyText = SUBSTRING(pr_info, 1, 100)
> From
> pubs.dbo.pub_info
> Where
> pub_id = '0736'
> Select @.MyText
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>|||Actually, my reply here was meant for the original thread, and applies
equally to both. They are still both dealing with how to get a chunk of
text from readtext into a varchar variable. There is no reason to carry on
multiple distinct conversations about the same thing.
> Aaron,
> If you really read my orignal posting you will see that while these
> postings
> are related, this one is more specific and focused on how to use the
> READTEXT. Since your own responses to each of my postings is different, at
> least on some level even you see them differently.|||> Thanks for your response. I believe I read in BOL that for ntext columns
> over 4000 characters one must use the READTEXT function. My data is
> longer
> than 4000, therefore I must use READTEXT to parse my data and return it to
> my
> program in, say, 1k chunks. Is this an incorrect approach?
Well, did you TRY using SUBSTRING? Did you try the code samples that have
been posted?
Also, why would you want to use 1k chunks? Didn't you say you wanted to
stuff it into an NVARCHAR variable or column? If so, then why not use 4k
chunks? And if all you are doing is returning the data to your program, why
not just say SELECT NTextColumn FROM table, the program shouldn't have
display limitations like Query Analyzer (8,192 characters).
A
No comments:
Post a Comment