PB12,数据窗口setsqlselect,若sql语句是执行存储过程,报异常

PB12,数据窗口setsqlselect,若sql语句是执行存储过程,报错误
PB12,数据窗口setsqlselect,
若sql语句是执行存储过程,报错误
select Error:Column lists do not match.
第一次执行的出现此错误提示,第二次以后,就不报错误了,能出现正确的数据。

在PB7时,此代码运行没有问题。

谁遇到过此类问题?

------解决方案--------------------
怎么连接的啊····
------解决方案--------------------
引用:
问题好像解决啦。
学习了一边setsqlselect的帮助,看到这样一句表述:
If the new SELECT statement has a different table name in the FROM clause and the DataWindow object is updatable, then PowerBuilder must change the update information for the DataWindow object.
我怀疑是因为存储过程的表名和原sql里表名不同,pb对dw进行设置出现的此错误提示。
我发现dw里果然设置update属性啦,将update属性取消,问题解决。


或者你可以考虑用modify试试,应该也可以,如

原来你用

string ls_sql
dw_1.setsqlselect(ls_sql)

你可以改为

dw_1.modify('datawindow.syntax = "' + ls_sql + '"')