7 Replies Latest reply on Mar 29, 2004 9:05 AM by APC

    Reserved Words - 10g vs 9i

      The 10g PL/SQL and SQL reference docs list the same reserved words as for 9i. Is this correct? (Why wouldn't, for example, something like "REGEXP_LIKE" be reserved in 10g?)
        • 1. Re: Reserved Words - 10g vs 9i
          I've never really got to grips with how Oracle allows some words that you would think should be reserved as object names. Consider this...
            2  /

          Table created.

          Steve Rooney
          • 2. Re: Reserved Words - 10g vs 9i
            Hello. I'm one of the tech writers responsible for the Oracle SQL Reference.

            The reserved word list has been frozen for eons, so as not to break existing customer code. If we keep adding reserved words, it's very likely that we will pick something already used by a customer. It's not hard to imagine, for example, a customer writing his/her own function called DECODE or REGEXP_LIKE.

            The SQL Ref. has a section "How Oracle Database Resolves Schema Object References" (in Chapter 2) that describes how the database deals with ambiguous database object names. Hope this helps.

            Diana Lorentz
            • 3. Re: Reserved Words - 10g vs 9i
              If you want to check which words are reserved, V$_RESERVED_WORD in the database might be more reliable than the documentation. There are also some words in the list which can be used, but we must assume that if we do so we might have problems in a future version.
              • 4. Re: Reserved Words - 10g vs 9i
                A small correction, Kevin. The words listed in V$RESERVED_WORDS are, for reasons unknown to me, not all reserved words. They are keywords. The list of truly reserved words in the SQL Reference is correct. I'll look into the V$RESERVED_WORDS issue and report back if I can find out why it is populated with keywords that are not reserved.

                • 5. Re: Reserved Words - 10g vs 9i

                  As Diana pointed out, the list of SQL reserved words has been frozen for a while. However, for PL/SQL, the current list of reserved keywords can be found by querying the v$reserved_words view. More than 200 new PL/SQL keywords (e.g., regexp_like) have been added to this view in 10g.

                  • 6. Re: Reserved Words - 10g vs 9i
                    v$reserved_words only gives the keyword and length. Try x$kwddef, which gives the keyword, length, and type. A type of (x mod 4)=1 means a keyword, and a type of (x mod 4)=2 means a reserved word.
                    • 7. Re: Reserved Words - 10g vs 9i
                      I'd just like to say 'Hi!' to Diane and Geoff. It's not often we get visitors from Oracle round these parts. It's nice to get some inside dope for once. Thanks for dropping by.

                      Cheers, APC