Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant defined is also a SQL reserved word, shows "Also defined in scope. Should likely be host variable." error. #2436

Open
BotanyBayDon1 opened this issue Dec 26, 2024 · 0 comments

Comments

@BotanyBayDon1
Copy link

See code below.
Constant ON is defined as Dcl-C on '1'
SQL code:
EXEC SQL
CREATE INDEX OR_COMMANDS_INDEX_1 FOR SYSTEM NAME CMDOBJI1
ON CMDOBJ (COMMAND_NAME, COMMAND_LIBRARY) RCDFMT CMDOBJR1;
This shows a "Also defined in scope. Should likely be host variable." in VS-Code.

IMO unless a program-defined variable, constant or structure is used as a host variable, embedded SQL statements should not otherwise be scanned for reserved words that match program-defined variables.

To Reproduce
Declare any constant, i.e., On or Off with values '1' / '0' respectively (or variable or constant matching an SQL reserved word.)
In Embedded SQL, use the reserved word (see above code.)

Expected behavior
Expect the parser not to show an error, as the reserved word is part of the SQL statement bounded by EXEC SQL and semi-colon at end of statement.

Screenshots
image

Environment (please complete the following information):
V7R4 & V7R5, VS-Code latest version as of 12/26/2024

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant