SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
S-90
Example—SUM
A host variable that receives the result of the SUM function must have an indicator 
variable to handle a possible null value. (For more information about using 
indicator variables, see the SQL/MP programming manual for your host language.)
Example—SUM
To compute the total value of parts in the current inventory (the sum of each value in 
the PRICE column multiplied by the corresponding value in the QTY_AVAILABLE 
column), type this:
>> SELECT SUM (PRICE * QTY_AVAILABLE) FROM SALES.PARTS;
(EXPR)
-----------
83052750.00
--- 1 row(s) selected.
Super ID
The super ID is a Guardian user ID with group number 255 and user number 255. The 
super ID is intended for system maintenance and administration and has many special 
privileges.
The super ID can read, write to, execute, and purge any object on the local node. The 
super ID can also resecure and alter attributes of objects on the local node.
A super ID on one node in a network does not have super ID privileges on other nodes 
in the network. Most super ID privileges require being directly logged on the local node 
as the super ID. However, a super ID with a remote password (not a logon password) 
to another node has group manager privileges (generalized owner privileges) for 
objects and files secured so that their owner can purge them remotely.
Syskeys
A SYSKEY, or system-defined primary key, is a primary key defined by SQL rather 
than by the user.
Tables stored in relative and entry-sequenced files or in key-sequenced files without a 
user-defined primary key have a primary key defined by SQL and stored in a column 
named SYSKEY.
SQL adds the SYSKEY column to the table definition for you; you do not supply it. 
SYSKEY is the first column in the table, and its data type depends on the organization 
of the file, as shown:
File Organization SYSKEY Data Type SYSKEY Value
Entry-sequenced INTEGER UNSIGNED 4-byte record address
Key-sequenced LARGEINT SIGNED 8-byte unique number
Relative INTEGER UNSIGNED 4-byte record number










