0

HANA 102.05 fails to execute the following code:

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;

complaining that:

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "SELECT": line 8 col 2 (at pos 124)

which points outside the proceudure, at SELECT 'Hello'. The procedure itself compiles without error. The entire script completes successfully if I remove the FOR UPDATE directive. What is wrong with the original?

Update

When I execute the same query from hdbsql.exe I get:

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)
Community
  • 1
  • 1
Anton Shepelev
  • 922
  • 9
  • 19
  • How are you executing the commands? In SAP HANA Studio? If so, then the problem is rather a HANA studio issue. The commands are syntactically correct and execute w/o issue e.g. in the Web-Based development workbench or hdbsql. – Lars Br. Nov 24 '16 at 21:06
  • I have updated my question with the error I get when using *hdbsql*. – Anton Shepelev Nov 25 '16 at 11:40
  • I told you two alternative ways - check those yourself please. This has nothing to do with the HANA version. Alternatively you might also just go and use a current version of HANA studio. – Lars Br. Nov 25 '16 at 08:47
  • I execute that script via SAP HANA Studio 2.1.19, but I doubt that it may be culpable. Is there a chance you can check it with HANA 102.05 or older? – Anton Shepelev Nov 25 '16 at 08:44

0 Answers0