Name

full_column_names — Control column-name format used in queries

Common Usage

PRAGMA full_column_names;
PRAGMA full_column_names = switch;

Description

The full_column_names pragma, in conjunction with the short_column_names pragma, controls how the database connection specifies and formats column names in result sets. If full_column_name is enabled, output column expressions that consist of a single named table column will be expanded to the full table_name.column_name format. It is off by default.

The general rules for output names are:

  • If an output column has an AS name clause, name is used.

  • If short_column_names is enabled and the output column is an unmodified source column, the result set column name is column_name .

  • If full_column_names is enabled and the output column is an unmodified source column, the result set column name is table_name.column_name.

  • The result set column name is the text of the column expression, as given.

If full_column_names and short_column_names are both enabled, short_column_names will override full_column_names.

Note that there is no guarantee the result set column names will remain consistent with future versions of SQLite. If your application depends on specific, recognizable column names, you should always use an AS clause.

See Also

short_column_names