PB调用存储过程的出错--急急急!!

wlj768 2010-06-16 11:09:31
sqlserver2000存储过程为:

ALTER procedure p_getmaxid(@tablename varchar(50),@preface varchar(50),@bh varchar(50) output)
as
begin tran
declare @i int
declare @curdate char(8)
select @curdate=replace(convert(char(11),getdate(),121),'-','')
update tablemax with(rowlock) set
@i=case when currentdate=@curdate then maxid+1 else 1 end,
currentdate = @curdate,
@bh= preface+@curdate+right(power(10,len)+@i,len),
maxid=@i
where preface = @preface and tablename=@tablename
commit tran

pb11.5中一个按钮中的调用为:
string bh,tablename,preface
tablename="bloodapp"
preface="app"
DECLARE pgetmaxid PROCEDURE FOR p_getmaxid
@tablename=:tablename,
@preface=:preface,
@bh=:bh output
using sqlca;
execute pgetmaxid;
if sqlca.sqlcode<>0 then
close pgetmaxid;
return
else
FETCH pgetmaxid INTO :bh;
if sqlca.sqlcode<>0 then
close pgetmaxid;
return
end if
end if


报错为:Database C0038:SQLSTATE=22005[ODBC SQL Server Driver]对于造型说明无效的字符串。
试了好多次都不行,另外,通过DW调用存储过程时,为什么只要是带参数的存储过程都报错。
...全文
109 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wlj768 2010-06-16
  • 打赏
  • 举报
回复
搞定,谢谢了!!
dawugui 2010-06-16
  • 打赏
  • 举报
回复
建议楼主直接用sql server专用接口连接数据库.
永生天地 2010-06-16
  • 打赏
  • 举报
回复
ODBC连接数据库是有这个问题,我也遇到,没法搞定。
就只能改成oledb连接

752

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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