开发者

How to collect value returned by select statement in sybase if select returns multiple row of value?

开发者 https://www.devze.com 2023-04-12 02:48 出处:网络
I have a query say \"select name from books_det\" ,and this query returns say 10 rows(name) , now i want to access the value of each and every row(i.e name) . How will i accomplish this in sybase?

I have a query say "select name from books_det" ,and this query returns say 10 rows(name) , now i want to access the value of each and every row(i.e name) . How will i accomplish this in sybase?

I have tried declare @var varchar select @var=name from books_det //but this r开发者_运维知识库eturns 10 rows i.e 10 name print @var go

This query doesn't seems to give any result. Can anyone please help ?


It seems that you need a cursor.

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.sqlug/html/sqlug/sqlug768.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号