PDA

View Full Version : Sybase Text Fields reading


Sbo
02-10-02, 17:03
Hi,
I got a temp table that has text field i would to read that text field in my stored proc. I am doing substrings to read the pieces of data from Text field but after 255 i cannot read anymore. Is there way that i can read the text all way to the end piece by piece.
Thank you.

ffeingol
02-11-02, 00:07
Sorry, I must be having a brain cramp.

Why can't you just:

select text_column
from YOUR_TABLE

??

Frank

Sbo
02-11-02, 13:06
Hi Frank,
I need to select the content of the text field into variable. But i cannot select the entire text into a single variable because the limit is 255 for variables and we cannot declare text as variable.
Thank you.

ffeingol
02-11-02, 13:17
OK, now I understand. I don't know of any way to get around that in a stored procedure.

Frank

MattR
02-11-02, 17:53
What version are you using? With ASE 12.5 you can define parameters up to 16,000 bytes.

If you are doing some SQL before the stored proc call you can stick the code in a temp table which is readable by the SP, e.g.

INSERT INTO #bob ( textcol ) VALUES( 'asfnksjdfh' )

CREATE PROC sp_gettextfromtemptable
AS
DECLARE @bob TEXT
SELECT @bob = textcol
FROM #bob
GO


Something like that.

Sbo
02-11-02, 18:48
Hi Matt ,
Thanks for the response. I am using 11.9.2 which does not allow to do this declaration of text field.
Thank you.