DB2动态SQL CUESOR
我可以在DB2光标中使用两个参数,然后使用:PARM1:PARM2
打开它 我的COBOL源是:
working-storage
01 parm1 pic x(09).
01 parm2 pic x(09).
procedure division.
move '080000' to parm1.
move '090000' to parm2.
move 'select s2p from grp2.arz where s2p > ? and < ?' to st.
然后我准备它:
exec-sql parepare s1 from :st statement1 end-exec.
exec-sql declare c1 vursor for s1 end-exec.
exec-sql open c1 using :parm1 :parm2 end-exec.
然后我从光标中获取。
在运行时间我有错误:
指示器变量PARM2不是小型类型!
can I use two parameters in db2 cursor and open it using :parm1 :parm2
my cobol source is:
working-storage
01 parm1 pic x(09).
01 parm2 pic x(09).
procedure division.
move '080000' to parm1.
move '090000' to parm2.
move 'select s2p from grp2.arz where s2p > ? and < ?' to st.
and then I prepare it:
exec-sql parepare s1 from :st statement1 end-exec.
exec-sql declare c1 vursor for s1 end-exec.
exec-sql open c1 using :parm1 :parm2 end-exec.
and then I fetch from the cursor.
In run time I got error:
indicator variable parm2 is not smallint type!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用在
中传递的参数必须由逗号分隔:
没有逗号DB2将其解释为一对主机变量和无效的指示灯。
The parameters passed in
using
have to separated by a comma:Without the comma DB2 is interpreting it as a pair of host-variable and null-indicator.