2 b26059 b26059 于 2016.03.20 17:34 提问

db2使用用户自定义函数时报错

自定义函数如下:
create function a(@sno char(6))
returns table(couname char(20),score int )
language sql
reads sql data
no external action
deterministic
return
(select cname,score from grade,course where grade.sno=@sno and grade.cno=course.cno);

调用语句如下:select a('990101')
报错信息如下:
An unexpected token "END-OF-STATEMENT" was found following "select a('990101')". Expected tokens may include: "".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.7.89

函数已经成功创建了,我应该如何调用呢?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!