Sorry this has taken me so long to get back to you on this I got caught up in something else. I tried to add the stored procedure but I got an error that said that
"Error 2379: The text, ntext, and Image data types are invalid for local variables."
I imagine this is being generated by line 8 of the procedure "declare @longvar text"
Is there any other data type we can use to get the same effect?
Thanks,
Scott
Main Topics
Browse All Topics





by: mcallarsePosted on 2002-10-29 at 11:05:39ID: 7384421
* Replaced your cursor with the Coalesce function.
+data,data )
)') C_ID_text, 1, 1) _ID_text, 2, 2) _text, 4, 2) C_ID_text, 1, 2) _ID_text, 3, 2) _text, 5, 2) d+' AND ' AND
CREATE PROCEDURE CONTENT_PROC
(
@TBL_NAME VARCHAR(1),
@REC_ID bigint,
@UUID_IN VARCHAR(1)
) AS
declare @longvar text
select
@longvar=coalesce(@longvar
from extended_data
where uuid=@UUID_IN
order by sort_order
IF UPPER(@TBL_NAME) = 'CM_CONTENTS'
begin
exec('UPDATE CM_CONTENTS SET CONTENT = '''+@longvar+''' WHERE (CONTENT_ID='+@REC_ID+')')
end
else IF UPPER(@TBL_NAME) = 'CM_MASS_EMAILS'
begin
exec('UPDATE CM_MASS_EMAILS SET CONTENT = '''+@longvar+''' WHERE (MASS_EMAIL_ID='+@REC_ID+'
end
else IF UPPER(@TBL_NAME) = 'CM_PAGE_CONTENT'
begin
declare @REC_ID_text varchar(8)
declare @instance_id varchar(2), @section_id varchar(2), @page_id varchar(2)
set @REC_ID_text = cast(@REC_ID as varchar(8))
IF LEN(@REC_ID_text) = 5
begin
set @instance_id=SUBSTRing(@RE
set @section_id=SUBSTRing(@REC
set @page_id=SUBSTRing(@REC_ID
end
ELSe IF LEN(@REC_ID_text) = 5
begin
set @instance_id=SUBSTRing(@RE
set @section_id=SUBSTRing(@REC
set @page_id=SUBSTRing(@REC_ID
end
exec
('UPDATE CM_PAGE_CONTENT
SET CONTENT='''+@longvar+'''
WHERE
(instance_id='+@instance_i
(section_id='+@section_id+
(page_id='+@page_id+')')
end