Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to disable '@' in SQL*Plus?

Re: How to disable '@' in SQL*Plus?

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Fri, 30 Jan 2004 10:45:50 +0000
Message-ID: <pmck10tjm658cb3j2rd7iis3aajtjrim3f@4ax.com>


On Thu, 29 Jan 2004 22:15:49 -0800, Daniel Morgan <damorgan_at_x.washington.edu> wrote:

>>>>I'm encouraging you to never use keywords for anything other than their
>>>>intended usage.
>>>
>>> But the OP posted an issue with an @ in a _literal string_, and a PL/SQL
>>>_comment_. So you're saying do not use any string present in V$RESERVED_WORDS
>>>in a literal string or a PL/SQL comment? That's rather limiting isn't it, given
>>>that useful things like spaces are in that view?
>>>
>>> It's clearly a bug in SQL*Plus (it has no right parsing anything other than
>>>substitution variables inside strings or comments, certainly not running them
>>>as an SQL*Plus command unless prefixed with the SQLPREFIX character); so how is
>>>it a fault on the part of the OP?
>>>
>>> Keywords shouldn't be used for identifiers, but this isn't about identifiers.
>>
>> SQL*Plus has a very basic command parser. There are some other listed
>> "features" at:
>>
>> http://otn.oracle.com/support/tech/sql_plus/htdocs/runtime2.html#minus_sign

 Which is documented at least. And substitution variables can be turned off.  

>> I expect the "@" issue has been a "feature" of SQL*Plus for the last 20 years.

 And is unlikely to ever be fixed, so the workaround is going to have to be "don't start a line with @". It's still a bug, since it's not documented; and does it ever make sense to execute a script in the middle of entering a command into the buffer?

>SQL*Plus is irrelevant to the fact that '@' is a keyword.

 And the fact that @ is a keyword is irrelevant to the issue being discussed.

>Rather than pontificating ... run the SQL statement I supplied.

 Have you? The space character is listed there. As are many other bits of punctuation. Only a leading @ causes a problem in SQL*Plus, and that's got nothing to do with it being a keyword, it's because SQL*Plus is incorrectly running a script when it should be accepting SQL or PL/SQL, not SQL*Plus commands.  

 Why should the fact that something is listed in v$reserved_words stop you from putting it in a comment or a literal string?

-- 
Andy Hassall <andy_at_andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Received on Fri Jan 30 2004 - 04:45:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US