May 24, 2002 at 9:49 pm
Hi, I am using a text datatype in one of my tables.
The problem is that i can retrieve only a part of the value in the column.
I use a stored procedure to retrieve the data.
Earlier I just did a select textcolumn from tablename.
That did not work.
So I changed the stored proc to
Set textsize 64512
select textcolumn from tablename
set textsize 0
again that did not retrieve all data
I am currently using
______________________________
set textsize 64512
DECLARE @ptrval varbinary(16)
DECLARE @length int
SELECT @ptrval = TEXTPTR(payload),@length=DATALENGTH(payload)
FROM [tMessagePayload]
WHERE
[MessageId] = @MessageId
READTEXT tMessagePayload.payload @ptrval 0 @length
________________________
@messageid is the key value for which the text is required.
When I run the stored proc in Query Analyser, I get the entire text.
However in the ASP where I call the stored proc, I get only a part of the value in the text column.
The asp code that calls the sp uses the command object.
___________________
strSQL = "stored procedure name"
objCn.Open g_strConnectionString
With objCmd
.Commandtext = strSQL
.Commandtype = adCmdStoredProc
Set .ActiveConnection = objCn
.Parameters.Append .CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Parameters.Append .CreateParameter("MessageId", adInteger, adParamInput, 4, m_intMessageId)
End With
Set objRs = objCmd.Execute
If objRs.EOF then
m_strErrDesc = "Message Incomplete. Please Contact Admin. MessageId : " & m_intMessageId
Else
Response.write( objRs(0))
End If
___________________
Any help would be appreciated.
Regards,
Rahul
May 24, 2002 at 10:20 pm
There is a bug that the text columns have to be the last columns in the query returned. For ASP/ADO.
Steve Jones
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply