Name
short_column_names — Control column-name format used in queries
Common Usage
PRAGMA short_column_names;
PRAGMA short_column_names = switch;Description
The short_column_names pragma, in conjunction with
the full_column_names pragma,
controls how the database connection specifies and formats
column names in result sets. If short_column_name is enabled, output column
expressions that consist of a single named table column will be
clipped to only include the column name. This pragma is on by
default.
The general rules for output names are:
If an output column has an
ASclause,nameis used.nameIf
short_column_namesis enabled and the output column is an unmodified source column, the result set column name is.column_nameIf
full_column_namesis enabled and the output column is an unmodified source column, the result set column name is.table_name.column_nameThe 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 use an AS clause.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access