WORKAROUND 1:
Use the SET DEFINE OFF statement before query.
For example, if you run this in Toad (with the F5 key) or in SQL Plus:
Set Define Off
SELECT username, account_status, lock_date, expiry_date, profile
FROM dba_users
WHERE username IN (
select username
from dba_users
where username like '%A%'
and account_status not in ( 'LOCKED', 'EXPIRED & LOCKED')
);
You will not be prompted to enter a variable prompt.
WORKAROUND 2:
Use the concatenation operator so that a literal does not start with the ampersand.
For example:
SELECT username, account_status, lock_date, expiry_date, profile
FROM dba_users
WHERE username IN (
select username
from dba_users
where username like '%A%'
and account_status not in ( 'LOCKED', 'EXPIRED &' || 'LOCKED')
);