TextPointer for NTEXT field returns NULL !?

  • The "UPDATETEXT function" on the second last line below returns the following error intermittently "NULL textptr (text, ntext, or image pointer) passed to UpdateText function" Does anyone know why it does this?

    DECLARE @jstext nvarchar(4000),

    @candidatedescr nvarchar(250),

    @ptrJobSpecText binary(16),

    @JobSpecTextValid bit

    --need to set JobSpecText pointer by updating the field first...

    UPDATE JobAds WITH (ROWLOCK)

    SET JobSpecText = N' '

    WHERE JobAdNo = 1

    --set the text pointer

    SELECT @ptrJobSpecText = TEXTPTR(JobSpecText)

    FROM JobAds

    WHERE JobAdNo = 1

    --check if pointer is valid

    DECLARE @ptrvalid int

    SELECT @ptrvalid = TEXTVALID(JobAds.JobSpecText, @ptrJobSpecText)

    FROM JobAds

    WHERE JobAdNo = 1

    IF @ptrvalid = 0

    BEGIN

    --need to set JobSpecText pointer by updating the field first...

    UPDATE JobAds WITH (ROWLOCK)

    SET JobSpecText = N' '

    WHERE JobAdNo = 1

    --set the text pointer

    SELECT @ptrJobSpecText = TEXTPTR(JobSpecText)

    FROM JobAds

    WHERE JobAdNo = 1

    END

    SET @jstext = @jstext + @candidatedescr + N' '

    UPDATETEXT JobAds.JobSpecText @ptrJobSpecText NULL 0 @jstext

    IF @@error <> 0 goto errorHandler

  • This was removed by the editor as SPAM

  • thanks , I will investigate using in row text ...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply