The next script can be saved, e.g., as “test.sql,” and successfully executed via SQLcl or SQL*Plus. It also works via “Run Script (F5)” in VS Code. However, it produces a syntax error in the VS Code extension 24.3.1.
-- set substituation variable
define linesize = 50
-- use substitution variable in select statement (no syntax error in VS Code)
select &&linesize
where &&linesize > 10;
-- use substitution variable in set command (syntax error in VS Code)
set linesize &&linesize
Here's the screenshot showing the complete error message:
