存储过程的调用:在SQL SERVER中可以,为什么PB中不可以???

kingman888 2002-04-06 06:23:48
1、存储过程声明:
CREATE PROCEDURE test
@iBillType Char(1),
@ID varChar(12) Output
AS

SET @ID = '12345'

2|、pb中的调用:
String ac_type, ls_id
ac_type = 'B'

DECLARE sp_duration PROCEDURE FOR test
@iBillType = :ac_type,
@id = :ls_id OUTPUT;

Execute sp_duration;

messagebox(ac_type,ls_id)

3、在sql server 中测试如下:正常
declare @dd varChar(12)
exec TEST 'B', @dd OUTPUT

if @dd is null
print 'IS NULL'
ELSE
print @dd
go


...全文
88 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingman888 2002-04-06
  • 打赏
  • 举报
回复
谢谢老大!!试试先!
zuoyangguang 2002-04-06
  • 打赏
  • 举报
回复
up
flyerlxg 2002-04-06
  • 打赏
  • 举报
回复
代码应该如下:
String ac_type, ls_id
DECLARE sp_duration PROCEDURE FOR test
@iBillType = :ac_type,
@id = :ls_id OUTPUT;
ac_type = 'B'
Execute sp_duration;
if sqlca.sqlcode = 0 then
fetch sp_duration into :ls_id;
end if
close sp_duration;
您只打开了,但还没有将数据读入变量中呀,试试看!
kingman888 2002-04-06
  • 打赏
  • 举报
回复
为什么在PB中返回的是NULL值??是不是调用存储过程的方法不对??
long5 2002-04-06
  • 打赏
  • 举报
回复
关注!

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧