易截截图软件、单文件、免安装、纯绿色、仅160KB

在存储过程中的查询delphi怎么出错

REATE procedure employee_select  @cust_num varchar(20),@ErrMsg varchar(100) out
as
            select @ErrMsg = ''
      if ((@cust_num is null ) or (@cust_num = ''))
        begin
select a.cust_num,a.cust_name,a.sex,b.sbname as custkindname,a.opername,a.opertime ,
(select c.sbname from dictionary c where c.type_id=2  and c.hold1 = a.custkind_id and c.serial_id = a.rating_id ) as cust,a.up_opername
from employee a ,dictionary b where type_id=1 and b.serial_id=a.custkind_id
return 0
end
if not exists(select * from employee where cust_num=@cust_num)
        begin
Set @ErrMsg='当前['+@cust_num+']信息不存在'
      Return -1

end
else
 
          begin
select a.cust_num,a.cust_name,a.sex,b.sbname as custkindname,a.opername,a.opertime ,
(select c.sbname from dictionary c where c.type_id=2  and c.hold1 = a.custkind_id and c.serial_id = a.rating_id ) as cust,a.up_opername
from employee a ,dictionary b where type_id=1 and b.serial_id=a.custkind_id and a.cust_num=@cust_num
  end
 
  return 0
GO
这是我的存储过程
在查询分析器里面房上参数有结果返回,
下面是在delphi的代码: <


相关问答:

ACCESS的自定义函数在delphi里怎么用呢...

我在模块里自定义了一个函数:stradd()

可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...

这个问题有什么办法可以解决的吗? 非常感激!


(在A ......

VC++ 中的&符号 对应的是Delphi中的哪个符号??

VC++ 中, &变量名。 是什么意思。 Delphi中 和他一样的符号 是哪个、?

大家都认为,C语言之所以强大,以及其自由性,很大部分体现在其灵活的指针运用上。因此,说指针是C语言的灵魂,一点都不为过。同时, ......

Delphi怎么取返回内容中的指定部分.

返回的内容是如下代码,怎么能渠道2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......

delphi 有关dbgrideh的dropdownlist

这个属性怎么用啊?
我想实现如下功能:在dbgrideh中按下箭头,如果当前指针停留在相应列上,就列出预设的几个选项,供用户选择(与combobox)类似
请问,用dropdownlist可否实现?
新手,帮你UP下 人气。
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号