There seems to be a problem with variable substitution within SQL Worksheet of SQL Developer 4.1.2 (Windows).
This works fine within SQL*Plus:
define cmd = "dir"
select '&&cmd' as cmd from dual;
SQL Worksheet accepts
select '&&cmd' as cmd from dual; -- returns "dir"
returns an error "&& was unexpected at this time". There seems to be a problem with variable substitution or this feature is not supported in SQL Worksheet.
According to the SQL Developer Help Center the SQL*Plus host statement is supported.
Has anybody a solution or experienced the same problem?
host is supported, you've ran into a known bug, thanks for the additional test case