DatabaseQuotingIdentifiers

Quoting Identifiers in SQL in NetBeans

This page attempts to identify the issues around quoting identifiers in NetBeans and the proposed solution to these issues

Overview

An identifier is the name of a SQL object -- a schema, table, column, view, index, constraint, stored procedure, etc.

For the purpose of this issue, identifiers in SQL can be separated into two distinct types:

  • New identifiers - an identifier that is being created as part of the current command
  • Referred identifiers - an existing identifier that is being referred to as part of the current command.

With this in mind, the principles driving this bug fix will be as follows:

The general opinion from users and our own experience is that quoting is to be avoided and generally not needed. There are special cases when an identifier contains special characters such as spaces, international characters and other special characters, but that is the exception rather than the rule.

  • We will not implicitly quote new identifiers. Users can explicitly quote new identifiers
 when specifying them.
  • By default, we will not quote referred identifiers for queries/commands
 that the user sees.  This includes Grab Structure.
  • Users can select an option to quote referred identifiers
  • To ensure correctness, we will always quote referred identifiers that are used in
 internal queries/commands that can not be modified by the user.  Note that this is safe to do because 
 these identifiers
 are obtained from DatabaseMetadata and will therefore be in the native case for the
 database.  

Option for Quoting Referred Identifiers

We will be adding a new choice to the Databases node's contextual menu (is that what you call it?)

Databases
  New Connection...
  Quote Identifiers [ ]
  ---------------------
  Enable Debug
  Disable Debug
The
Quote Identifiers
item will be a toggle check.

It would be nice to make it clear we are talking about referred identifiers in queries visible to the user, but I'm not sure how I could possibly express that in a menu choice. Ideas and thoughts most appreciated.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo