我的要求是声明一个接受最大大小的 xml 值的数据类型。
问题:Sybase 中有 text、xml 或 varchar(max) 数据类型吗?
有文本数据类型。您可以找到更多信息here http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.sqlug/html/sqlug/sqlug210.htm.
使用方法与程序:
create procedure settxt
(
@txt text
)
as
begin
select @txt
end
如何运行该程序:
declare @txt text
select @txt = 'Hello world'
execute settxt @txt
该代码适用于我,但可能不适用于所有人。
这是临时表的解决方案:
create table #texttab
(
txt varchar(100)
)
go
insert into #texttab
values ('Hello ')
insert into #texttab
values (' wolrd!')
go
create procedure settxt
as
begin
declare @txt text,
@txtval varchar(100)
select @txt=' '
declare curTXT cursor for
select txt from #texttab
open curTXT
fetch curTXT into @txtval
while @@sqlstatus=0 begin
select @txtval
select @txt=@txt+@txtval
select @txt
fetch curTXT into @txtval
end
close curTXT
deallocate cursor curTXT
select @txt
end
go
execute settxt
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)