HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems

Chapter 8 Expressions

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This chapter discusses value specification. The following sections are presented:

  • Expression

  • Add Months Function

  • Aggregate Functions

  • CAST Function

  • Constant

  • Current Functions

  • Date/Time Functions

  • Long Column Functions

  • String Functions

  • TID Function

An expression specifies a value to be obtained in one of the following ways:

  • From a column of a table

  • From a host variable in an application program

  • From a dynamic parameter

  • From a local variable or parameter in a procedure

  • From a constant

  • By adding, subtracting, multiplying, dividing, or negating values

  • By evaluating an aggregate function

  • By evaluating a date/time (conversion, current, or add months) function

  • By evaluating a long column or string function

  • By a combination of these methods

Expressions are used for several purposes including:

  • To identify columns. In the SELECT statement, expressions are used in the select list to identify column values to be retrieved.

    The SELECT statement is also part of the CREATE VIEW, DECLARE CURSOR, and INSERT statements. The expressions in this case identify columns that qualify for the view, the cursor, or the insert operation.

  • To identify rows. In the search condition of the following statements, expressions help define the set of rows affected: SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, and DECLARE. Refer to the "Search Conditions" chapter for more information.

  • To define new column values. In the UPDATE statement, expressions define a new value for a column in an existing row.

Feedback to webmaster