che-che4z-lsp-for-cobol
che-che4z-lsp-for-cobol copied to clipboard
SQL: Support EXEC SQL VAR
This is a hint to the SQL preparser about the type of bind variables on the DB side, samples:
EXEC SQL VAR MYTYPE IS CHAR END-EXEC.
EXEC SQL VAR MYKEY IS CHAR END-EXEC.
Those references are bind variables (so part of the sql DECLARE SECTION
).
It is possibly totally fine to just "skip" those lines in the lsp.
Current result:
{
"resource": "test.pco",
"owner": "_generated_diagnostic_collection_name_#1",
"severity": 8,
"message": "Syntax error on 'VAR' expected {BEGIN, DECLARE, END, INCLUDE}",
"source": "COBOL Language Support - E",
"startLineNumber": 73,
"startColumn": 21,
"endLineNumber": 73,
"endColumn": 24
}
There is an option to turn off CICS or SQL in settings. Would this help?
"cobol-lsp.analysis.features": [
"CICS", "SQL"
]
Hello @GitMensch EXEC SQL VAR
looks like a non-standard extension that is not supported by IBM Enterprise COBOL for z/OS.
And it's Db2 preprocessor.
Yes, this is not in the statement list https://www.ibm.com/docs/en/db2/11.5?topic=sql-statements which instead uses USAGE SQL TYPE
after EXEC SQL BEGIN DECLARE SECTION
. Just to recheck: is that supported completely?
Otherwise it is "only" a common extension for (nearly all?) other SQL preprocessors, so I'd suggest to not close it but move it to an open sql dialect issue instead... or come back to this as part of #2158.
All of Db2 SQL including host variables should be supported with the recent 2.2.0 release.