0

HANA 102.05 无法执行以下代码:

CREATE TABLE ATABLE( f INT );

CREATE PROCEDURE TestProc()
AS
BEGIN
    SELECT f FROM ATABLE
    FOR UPDATE; -- Without FOR UPDATE it works
END;

SELECT 'Hello' FROM DUMMY;

抱怨:

SAP DBTech JDBC:[257]:sql 语法错误:“SELECT”附近的语法不正确:第 8 行第 2 行(在 pos 124)

它指向程序之外,在SELECT 'Hello'。该过程本身编译没有错误。FOR UPDATE如果我删除指令,整个脚本将成功完成。原版有什么问题?

更新

当我从hdbsql.exe执行相同的查询时,我得到:

0 rows affected (overall time 26,076 msec; server time 6518 usec)

* 257: sql syntax error: line 5 col 9 (at pos 71) SQLSTATE: HY000
* 257: sql syntax error: incorrect syntax near "END": line 2 col 1 (at pos 32) SQLSTATE: HY000
'Hello'
"Hello"

1 row selected (overall time 4644 usec; server time 143 usec)
4

0 回答 0