READTEXT

Aug 16, 1999

I am having issues READING an entire text field.
Also the SET TEXT command is returning only 255, too! Help!

My code:


DECLARE @ptrval binary(16)
, @TextSize int

SELECT @TextSize = (Select dataLength(pr_info)
FROM pub_info pr INNER JOIN publishers p
ON pr.pub_id = p.pub_id
AND p.pub_name = 'New Moon Books')

SELECT @ptrval = TEXTPTR(pr_info)
FROM pub_info pr INNER JOIN publishers p
ON pr.pub_id = p.pub_id
AND p.pub_name = 'New Moon Books'

READTEXT pub_info.pr_info @ptrval 0 @TextSize

View 2 Replies


ADVERTISEMENT

READTEXT And EXECUTE

May 6, 1999

I am working on a SQL 6.5 application that contains several tables with text fields. I would like to write a single stored procedure that could build the READTEXT statement for the text field on the fly based on parameters I pass in for the table name, column name, etc.

The procedure I want to write would look something like:

declare @txtpnt varbinary(16)
declare @column varchar(15)
declare @table varchar(15)
declare @idfield varchar(15)
declare @idval varchar(15)

EXECUTE ('select @txtpnt = textptr(' + @column + ')from ' +
@table + ' where ' + @idfield + ' = ' + @idval)
EXECUTE ('READTEXT ' + @table + '.' + @column + ' ' + @txtpnt + ' 0 10000')

Pretty as this looks, if you run this code, you will find that it doesn't work. The EXECUTE statement will not allow you to use a variable in the statement that is not declared as part of the statement. However, if I declare the variable as part of the EXECUTE statement, it is not recognized at compile time and I get an error when I create the stored procedure.

Is this the brick wall it seems to be, or am I missing something obvious here? I am using Access 97 as my front end, if that helps at all.
Any insight would be appreciated!

View 1 Replies View Related

Readtext Into A Variable

May 2, 2008

hi, has anyone ever tried saving the result of 'readtext' (ofcourse, not the entire text - just some of it usnig offsets in the readtext as : readtext texttab.textcolumn @ptr 0 100 ) into a 'varchar' variable ? if so, can you give me an example pls ?

thanks.

View 1 Replies View Related

READTEXT Not Returning All Data

Apr 12, 2004

SELECT @@TEXTSIZE
SET TEXTSIZE 4096
SELECT @@TEXTSIZE
GO
DECLARE @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(emailTemplates.Data)
FROM emailTemplates WHERE [Name] = 'AccountInfoReceipt1'
READTEXT emailTemplates.Data @ptrval 0 2000
GO


Thats my code. and it never returns the entire email template. why?

thx in adv

View 2 Replies View Related

READTEXT And Return Values

Apr 29, 2004

First question :

How can I set the return value of READTEXT to a variable of type nvarchar.

Second question :


I have a table t1 with a ntext column n1.

The ntext column has has words separated by empty space.
Each word can be assumed to be of size <= 255 characters.

How can I extract all the keywords in the ntext column to a table t2 with a column word nvarchar(255).

Assume that the text in column n1 is big enough so that it cannot be cast into a nvarchar or any other simpler type.



Any help on this is greatly appreciated.
Please do provide a sample code.

Alok.

View 1 Replies View Related

WRITETEXT Returned By A READTEXT

Aug 31, 2007

In my stored procedure I need to do a WRITETEXT on some text data which is being returned from a READTEXT on other text data. I thought that this sort of thing would work:

DECLARE @comment varbinary(16)
DECLARE @comment_len int
DECLARE @comment_new varbinary(16)
...
SET @comment = TEXTPTR(atextcolumn) from atable where ...
SET @comment_len = DATALENGTH(atextcolumn) from atable where ...
SET @comment_new = TEXTPTR(anothertextcolumn) from anothertable where ...

WRITETEXT anothertextcolumn @comment_new READTEXT atextcolumn @comment 0 @comment_len

but I get the message from SQL Query Analyzer:

"Data stream missing from WRITETEXT statement."

I thought the READTEXT returned a data stream.

There must be a way to do what I want. Does anybody know what it is ?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved