SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
C-44
Column Identifier
Column Identifier
A column identifier is used in some SQLCI report writer statements to specify a column
in the result of a SELECT command or a named column in the detail list.
column-name
is the name of a column specified in the select list. You must qualify an unqualified
name if it is the same as any other unqualified name in the select list. For example,
if the select list includes EMPLOYEE.DEPTNUM and DEPT.DEPTNUM, you must
qualify these names when specifying a column identifier. If only
EMPLOYEE.DEPTNUM is in the select list, you can omit the qualifier.
COL number
specifies the column in position number of the select list. The first item in the
select list is COL 1. You can use this form to refer to literals and expressions.
alias
is defined in a NAME command. You can use this form to refer to a name you
assign to a literal or expression. For more information, see Alias on page A-6.
detail-alias
is a detail alias name defined in the NAME clause of a DETAIL command. You can
use a detail alias name as a column identifier in any command except DETAIL. For
more information, see Detail Alias
on page D-46.
Example—Column Identifiers
These are different ways to designate the same column:
SELECT DEPTNUM FROM $SQL.PERSNL.EMPLOYEE;
SELECT EMPLOYEE.DEPTNUM FROM $SQL.PERSNL.EMPLOYEE;
SELECT DNUM FROM $SQL.PERSNL.EMPLOYEE;
{ column-name }
{ COL number }
{ alias }
{ detail-alias }