Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3228

HANA SQL commenting code

$
0
0

I found an interesting feature in HANA SQL (8.5) that doesn't appear to be documented or mentioned, but can be frustrating if you are unaware:


If you include a non-closed inverted comma in your slash asterisk comment, the code will still compile, but only if it DOESN'T end with a semi-colon. It gets confusing when the reported error references the semi-colon rather than the offending inverted comma.

It will also refuse to compile a stored procedure with such an error.

This error won't occur when using the -- style comment. So:


SELECT COLUMN FROM TABLE /* This won't work */;

SELECT COLUMN FROM TABLE /* This'll work */

SELECT COLUMN FROM TABLE /* This will work */;

SELECT COLUMN FROM TABLE /* 'This will work' */;

SELECT COLUMN FROM TABLE -- This will work;

SELECT COLUMN FROM TABLE -- This'll work;

 

This is mainly a problem for people who:

a) comment their code.

b) insist on using correct punctuation.


Viewing all articles
Browse latest Browse all 3228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>