我需要 Sybase 数据类型来保存不定长度的字符串。

2024-02-25

我的要求是声明一个接受最大大小的 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(使用前将#替换为@)

我需要 Sybase 数据类型来保存不定长度的字符串。 的相关文章

  • 在现有播放器上启用 YouTube API

    我有一个嵌入式 YouTube 视频 我希望应用 YouTube API 我使用 jQuery 添加 url 参数 如下所示 demo http jsfiddle net VVEY9 document ready function var
  • java字符串日期转换

    我想在存储字符串之前将其转换为日期 并且我使用了 SimpleDateFormat format new SimpleDateFormat yyyy mm dd Date returnDate format parse date 当我使用样
  • 在 MS SQL Server 2008 中创建序列

    我编写了一个程序 可以在其中请求身份证 有不同类型的身份证 红 蓝 绿 当提出请求时 程序应该生成标识号 数字 数字范围 取决于所请求的卡 Red Card 1 50000 Blue Card 50001 100000 Green Card
  • 为什么 VS Code 在 java 文件中显示 System.out.println() 的这些标签或参数名称?

    我已经安装了java扩展包 这件事从今天才开始发生 不确定这是由于某些 json 设置还是其他原因造成的 See 诸如 s x 和 参数名称之类的随机内容出现在我的打印语句中 https github com redhat develope

随机推荐