Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2003
    Posts
    60

    Post Unanswered: text field being truncated

    Any Idea why my text field is being truncated when updating a table.

    This is the basic problem

    I have a stored procdure that expects 2 parameters, 1 is the ID and 1 is a TEXT field. The stored procedure updates a column to to text field being passed in.

    only the first 8192 characters of my text field are being updated. the rest are being lost.

    I have the textsize set to 64512 in the databse.

    Any ideas?????

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    are you using straight update or updatetext?

  3. #3
    Join Date
    Oct 2003
    Posts
    60
    I am using a striaght update.. I did try using updatetext and that did not work either.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Originally posted by scottb
    I am using a striaght update.. I did try using updatetext and that did not work either.
    Text fields are a pain...you have to update them in chucks...gotta get the text ponter and alll...now where did I put that code....


    Something like:

    Code:
    Select @ptrValue = TextPtr(imgPicture) from Table1 Where charKey = 'A'
    
    	If TextValid('Table1.imgPicture', @ptrValue) <>  1
    		BEGIN
    			Select @Error_Loc = 1
    			Select @Error_Message = 'Pointer value not valid.  Value equals: ' + RTrim(Convert(Char(16),@ptrValue))
    			Select @Error_Type = 50002
      			GOTO ImageTest3_Error
    		END
    
      	ReadText Table1.imgPicture @ptrValue @Offset @Size
    
    	Select @Result_Count = @@ROWCOUNT, @error_out = @@error
    
    	If @error_out <> 0
    		BEGIN
    			Select @Error_Loc = 2
    			Select @Error_Type = 50001
      			GOTO ImageTest3_Error
    		END
    I'm curious now...if you don't use UPDATETEXT, do you use READTEXT?

    I avoid this stuff though...better off storing file names and paths in the database..

    My Own Opinion

    MOO
    Last edited by Brett Kaiser; 10-16-03 at 17:33.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Oct 2003
    Posts
    60
    thanks man...

    i am sort of new to the whole text data type...

    i was just using a straight update.

    this sounds like a big pain the butt..

    lucky i have tomorrow off so i don't have to look at this until monday

  6. #6
    Join Date
    Sep 2003
    Posts
    522
    actually, you can write/read text/image fields right from the front-end with rs.Edit/Add...rs.Update

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Originally posted by ms_sql_dba
    actually, you can write/read text/image fields right from the front-end with rs.Edit/Add...rs.Update
    And that's about...don't plan on manipualting them with sql....

    Text datatype seems to be overused and for the wrong purpose...

    Hey 8000 is a lot of characters....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Oct 2003
    Posts
    60
    Ok,
    I am confused.

    lets say I use this stored procedure below, I want to update a table called SCOTT_TEST where ID = @x

    How would I use updatetext to do this??


    create procedure sp_Test (
    @xml text,
    @x int
    )
    as

  9. #9
    Join Date
    Sep 2003
    Posts
    522

  10. #10
    Join Date
    Oct 2003
    Posts
    60
    thanks

    stupid me .. my problem was, i was trying to return my image in query analyzer. I forgot i could only return 8192 characters.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •