起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 276|回复: 15

【结帖】存储过程数据集不返回结果**

[复制链接]
发表于 2008-4-23 17:28:28 | 显示全部楼层 |阅读模式
存储过程数据集没有结果,存储过程:

CREATE PROCEDURE dbo.proc_pg_order_query;1
@com_id char(4) ,@dept_id char(8),@flag_return char(1)
AS
    BEGIN
SELECT dept_name=ctlm08.report_order+ctlm08.dept_name,   
         corr_name=ctlm23.corr_id+ctlm23.corr_name,   
         flag_return=sat04.flag_return,   
         item_name=ctlm22.item_name,   
         spec=ctlm22.spec,   
         unit_name=ctlm17.unit_name,   
         qty_d_order=sat05.qty_d_order,   
         amt_d_order=sat05.amt_d_order,   
         sa_price=sat05.sa_price,   
         p_g_order_no=sat04.p_g_order_no,   
         d_remark= sat04.d_remark,   
         date_of_fill=sat04.date_of_fill,   
         l_date_d=sat04.l_date_d,   
         s_man_name=sam10.s_man_name,   
         receive_date=sat04.receive_date ,
         reas_name = (select sam09.reas_name from sam09 where sam09.com_id=@com_id and sam09.reas_code=sat05.reas_code)
    FROM ctlm08,   
         ctlm17,   
         ctlm23,   
         ctlm22,   
         sat04,   
         sat05,   
         sam10  
   WHERE sat04.com_id = sat05.com_id  and  
         sat04.p_g_order_no = sat05.p_g_order_no  and  
          sat05.com_id = ctlm22.com_id  and  
        sat05.item_no = ctlm22.item_no  and  
      sat04.com_id = ctlm08.com_id  and  
        sat04.dept_code = ctlm08.dept_id and  
        sat04.com_id = ctlm23.com_id  and  
       sat04.c_code = ctlm23.corr_id  and  
       sat05.com_id = ctlm17.com_id and  
       sat05.sa_unit = ctlm17.unit and  
      sat04.com_id = sam10.com_id and  
        sat04.s_man_code = sam10.s_man_code and  
          sat04.com_id = @com_id AND  
          sat04.dept_code = @dept_id AND  
          sat04.flag_return = @flag_return AND  
         ( sat04.date_of_fill between '2006-1-31 00:00:00'  and  '2008-3-31 23:59:59' )   
    END


开发平台中的执行:DataSetBroker1.DataSet.Close;
DataSetBroker1.DataSet.Params.ParamByName('@com_id').AsString:=edit1.text;
DataSetBroker1.DataSet.Params.ParamByName('@dept_name').AsString:=ComboBox1.Text;
DataSetBroker1.DataSet.Params.ParamByName('@flag_return').AsString:=s;
DataSetBroker1.DataSet.execute;
DataSetBroker1.DataSet.Open;

数据库为sybase,经过测试该存储过程无误,返回数据符合要求,但是在x3中返回的数据集为空
回复

使用道具 举报

 楼主| 发表于 2008-4-23 17:39:42 | 显示全部楼层
以前做过一个比这个复杂的存储过程,开始的时候可以;后来因为需要在存储过程中添加了游标、临时表及自增字段等,同样测试存储过程没问题就是x3中数据为空。因为升级问题那个问题暂时放下了。现在做一个比较简单的报表又遇到了这个问题,请帮忙解决一下,以后我们主要是依靠存储过程数据集了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 17:40:36 | 显示全部楼层
我们用的开发服务器版本是2800
回复 支持 反对

使用道具 举报

发表于 2008-4-23 17:51:49 | 显示全部楼层
服务端报错了没有??
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 17:52:56 | 显示全部楼层
没有,一切都正常,就是作为测试的ShowMessage没有结果,是空的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 18:00:19 | 显示全部楼层
请帮助解决下
回复 支持 反对

使用道具 举报

发表于 2008-4-23 18:02:35 | 显示全部楼层
ShowMessage???能测试数据集吗?  另外执行存储必须用专用控件的

http://bbs.justep.com/forum.php?mod=viewthread&tid=15936
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 18:05:48 | 显示全部楼层
showmessage用来看数据集中的第一条数据是否为空,从而判断存储过程是否执行,存储过程数据集中是否有数据。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 18:13:09 | 显示全部楼层
存储过程用的是存储过程数据集
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-23 18:33:20 | 显示全部楼层
下班了?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-11 15:27 , Processed in 0.049793 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表