首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Sybase >

sybase 存储过程 print 输出SQL不完整的有关问题

2012-02-28 
sybase 存储过程 print 输出SQL不完整的问题一个proc里面有语句输出sql便于调试,但是,用print,不能全部显

sybase 存储过程 print 输出SQL不完整的问题
一个proc
里面有语句输出sql便于调试,但是,用print,不能全部显示,
print   @sqlstr1  

比如显示:
select   t.colthno,   substring(t.color_nos,1,3)   as   color,t.colthname,t1.brand,t1.kind,t1._year,t1.season,t1.sex,t1.b_class,t1.serial,
sum(case   when   t.dbno= '1001 '   then   t.XS   else   0   end)   as   [销售1001],sum(case   when   t.dbno= '1001 '   then   t.QRC   else   0   end)   as   [存货1001],
sum(case   when   t.dbno= '1002 '   then   t.XS   else   0   end)   as   [销售1002],sum(case   when   t.dbno= '1002 '   then   t.QRC   else   0   end)   as   [存货1002],
sum(case   when   t.dbno= '1004 '   then   t.XS   else   0   end)   as   [销售1004],sum(case   when   t.dbno= '1004 '   then   t.QRC   else   0   end)   as   [存货1004],
sum(case   when   t.dbno= '1005 '   then   t.XS   else   0   end)   as   [销售1005],sum(case   when   t.dbno= '1005 '   then   t.QRC   else   0   end)   as   [存货1005],
sum(case   when   t.dbno= '1006 '   then   t.XS   else   0   end)   as   [销售1006],sum(case   when   t.dbno= '1006 '   then   t.QRC   else   0   end)   as   [存货1006],
sum(case   when   t.dbno= '1007 '   then   t.XS   else   0   end)   as   [销售1007],sum(case   when   t.dbno= '1007 '   then   t.QRC   else   0   end)   as   [存货1007],
sum(case   when   t.dbno= '1008 '   then   t.XS   else   0   end)   as   [销售1008],sum(case   when   t.dbno= '1008 '   then   t.QRC   else   0   en
(1   row   affected)
(return   status   =   0)

[解决办法]
在转换为SQL2000格式,用查询分析器测试,sybase和sql2000的语法差不多的。
或者用rapid sql 来调试

热点排行