SQLPlus Identifier Case — Defaults and Behavior When working in SQLPlus, Oracle commands, column names, table names, and other identifiers are typically treated how with respect to case (ignoring quoted identifiers)?

Difficulty: Easy

Correct Answer: They are case insensitive.

Explanation:


Introduction:
Understanding how Oracle and SQLPlus handle identifier case helps prevent confusing errors when writing scripts and querying the data dictionary. By default, unquoted identifiers are normalized by the database, which affects how names are stored and matched.


Given Data / Assumptions:

  • SQLPlus passes SQL statements to Oracle for parsing.
  • Unquoted identifiers are folded to uppercase by Oracle and compared case insensitively.
  • Quoted identifiers preserve case but require consistent quoting to reference.


Concept / Approach:
When you create an object without quotes (for example, CREATE TABLE myTable ...), Oracle stores the name internally in uppercase (MYTABLE). Subsequent references without quotes will match regardless of the case you type in SQLPlus. Case sensitivity appears only when you intentionally use quoted identifiers (for example, "MyTable"), which then must be referenced exactly, including case and quotes. Therefore, by default and in typical practice, identifiers behave case insensitively in SQLPlus.


Step-by-Step Solution:
1) Consider an unquoted identifier: create table mytab ...2) Oracle stores MYTAB; SELECT * FROM MyTab succeeds because matching is case insensitive for unquoted identifiers.3) If created as "MyTab", you must always use SELECT * FROM "MyTab".4) Conclude that the default behavior is effectively case insensitive.


Verification / Alternative check:
Data dictionary views (USER_TABLES) show object names in uppercase for unquoted definitions, supporting the folding behavior.


Why Other Options Are Wrong:

  • Case sensitive: Only true with quoted identifiers.
  • Always lower/upper: Users can type any case; Oracle folds unquoted names.
  • Mixed sensitivity by object type: Not accurate; rules apply uniformly to unquoted identifiers.


Common Pitfalls:
Creating quoted identifiers and later forgetting to quote them exactly, leading to “table or view does not exist” errors.


Final Answer:
They are case insensitive.

More Questions from Managing Databases with Oracle

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion