SQL$HELP72.HLB  —  Value Expressions
    A value expression is a symbol or string of symbols used to
    represent or calculate a single value. When you use a value
    expression in a statement, SQL retrieves or calculates the value
    associated with the expression and uses that value when executing
    the statement.

    Value expressions are also called scalar expressions or
    expressions.

    There are several different types of value expressions:

    o  A literal directly specifies a value. See the Literals HELP
       topic for more information.

    o  A parameter represents a value in a host language program or
       in an SQL module. See the User_Supplied_Names HELP topic for
       more information.

    o  A column name represents a value contained in table rows. See
       the User_Supplied_Names HELP topic for details on specifying
       value expressions with column names.

    o  A column select expression used as a value expression
       specifies a one-value result table. See the Column_Select_
       Expressions HELP topic for more information.

    o  A built-in function calculates values based on input value
       expressions. See the Built_In_Functions HELP topic for
       details.

       SQL built-in functions include functions such as CAST,
       CURRENT_USER, and TRIM. For a complete list of built-in
       functions, see Built In Functions.

    o  An aggregate function calculates a single value for a
       collection of rows in a result table. See the Aggregate_
       Functions HELP topic for details.

       SQL aggregate functions are:

       -  AVG

       -  COUNT

       -  MAX

       -  MIN

       -  STDDEV, STDDEV_SAMP, STDDEV_POP

       -  SUM

       -  VARIANCE, VAR_SAMP, VAR_POP

    o  SQL functions (CONCAT, CONCAT_WS, CONVERT, DECODE, GREATEST,
       LEAST, LENGTH, LENGTHB, SIGN, SYSDATE, SYSTIMESTAMP, SYS_
       GUID, ROUND and TRUNC) have been added to the Oracle Rdb SQL
       interface for convergence with Oracle SQL. See the Oracle
       Server SQL Language Reference Manual for more information.

    o  The DBKEY or ROWID keyword represents the value of an internal
       pointer called a database key to a table row. The ROWID
       keyword is a synonym to the DBKEY keyword. See the DBKEY HELP
       topic for more information.

    o  A character value expression represents a value that belongs
       to the CHAR, CHARACTER, VARCHAR, LONG VARCHAR, NCHAR, or
       NCHAR VARYING data type. You can link two character value
       expressions together using the concatenation operator (||).

    o  You can also combine certain value expressions with arithmetic
       operators to form a value expression.

    o  A substring specifies a portion of a character value
       expression that you can manipulate using arithmetic operators.

    o  A conditional expression is a form of the value expression
       that allows applications to return alternative information
       within an expression. See the Conditional_Expressions HELP
       topic for details.

       Conditional expressions are:

       -  ABS

       -  CASE

       -  COALESCE (or NVL)

       -  DECODE

       -  GREATEST

       -  LEAST

       -  NULLIF

       -  NVL2

       -  SIGN

    The following syntax diagrams show the format of an SQL value
    expression:

  (B)0value-expr =                            
                                          
  qqqwqq> numeric-value-expr qqqqqwqqqqq> 
     tqq> char-value-expr qqqqqqqqu       
     tqq> date-time-value-expr qqqu       
     tqq> interval-value-expr qqqqu       
     tqq> date-vms-value-expr qqqqu       
     tqq> DBKEY qqqqqqqqqqqqqqqqqqu       
     tqq> NULL qqqqqqqqqqqqqqqqqqqu
     mqq> ROWID qqqqqqqqqqqqqqqqqqj       

  (B)0numeric-value-expr =                                
                                                      
  qqwqwqqqqqqwq> numeric-value-factor qqwqqqqqqqqqqq> 
    x tq> + qu                          tq> + qwqk    
    x mq> - qj                          tq> - qu x    
    x                                   tq> * qu x    
    x                                   mq> / qj x    
    mqqqqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqqj    
                                                      

  (B)0numeric-value-factor =                                             
                                                                     
  qqwqqq> common-value-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> 
    tqqq> numeric-literal qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu    
    tqqq> BITSTRING (numeric-value-expr FROM qqqqqk             x
    x     lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj             x
    x     mq> <start-position> qwqqqqqqqqqqqqqqqqqqqqqqqqwq ) qqu
    x                           mq> FOR <string-length> qj      x
    tqqq> uid-numeric-functions qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu    
    tqqq> length-value-functions qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu    
    tqqq> POSITION qq> ( qq> char-value-expr IN qqqqk           x    
    x  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj           x
    x  mq> char-value-expr qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqwq> ) qu    
    x                        m> FROM numeric-value-expr qj      x    
    mqqq> EXTRACT qq> ( date-time-field qqk                     x 
         lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj                     x 
         mqqq> FROM qq> date-time-value-expr ) qqqqqqqqqqqqqqqqqj 

  (B)0common-value-expr =                                               
                                                                    
  qwq> <column-name> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq> 
   tq> <parameter> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> <qualified-parameter> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> <variable> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> (col-select-expr) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> CAST qq> ( qq> value-expr q> AS wq> data-type qqqqqw> ) qu   
   x                                   mq> <domain-name> qj     x   
   tq> VALUE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> aggregate-function qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> conditional-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   tq> function-invocation qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu   
   mq> (value-expr) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj   
                                                                    

  (B)0aggregate-function =                                                          
                                                                                
  qwq> COUNT (*) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqqqqqqqqqqqqqqqqw>
   tq> COUNT qqqqwq>( qwqqqqqqqqqqqqqqwq> value-expr q> ) qqu m> filter-clause j
   tq> AVG qqqqqqu     tq> ALL qqqqqqqu                     x                   
   tq> MIN qqqqqqu     mq> DISTINCT qqj                     x                   
   tq> MAX qqqqqqu                                          x                   
   tq> SUM qqqqqqu                                          x                   
   tq> STDDEV qqqu                                          x                   
   tq> VARIANCE qj                                          x
   tq> STDDEV_POP qqwqq>( q> numeric-value-expr qq> ) qqqqqqj 
   tq> STDDEV_SAMP qu
   tq> VAR_POP  qqqqu
   mq> VAR_SAMP  qqqj

  (B)0filter-clause =
  qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
   mq> ( qq> WHERE qq> predicate  qq> )  qqj

  (B)0conditional-expr =                                                 
                                                                     
  qwq> NULLIF qq>  ( qq> value-expr qq> , qq> value-expr qq> ) qqqqqqqqqqwq>
   tq> COALESCE qwq> ( q> value-expr qwq> , qq> value-expr wq> ) qqqqqqqqu
   tq> NVL qqqqqqu                    mqqqqqqqqq <qqqqqqqqqj             x
   tq> GREATEST qu                                                       x
   tq> LEAST qqqqj                                                       x
   tq> NVL2 (value-expr, value-expr, value-expr) qqqqqqqqqqqqqqqqqqqqqqqqu
   tq> DECODE (value-expr, qw> search , result wqqwqqqqqqqqqqqqqqwqq> ) qu
   x                        mqqqqqqq , <qqqqqqqj  mq> , default qj       x
   tq> ABS qqwq> (value-expr) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
   tq> SIGN qj                                                           x
   tq> simple-case-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
   mq> searched-case-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

  (B)0simple-case-expr =                                                  
                                                                      
  q> CASE q> value-expr w> WHEN with-values qqq> THEN q> value-expr qwk 
                        mqqqqqqqqqqqq-qqqqqqqqq <qqqqqqqqqqqqqqqqqqqqjx 
  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq-qq <qqqqqqq-qqqqqqqqqqqqqqqqqqqqj 
  mqwqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqq> END qqqqqqqqqqqqqqqqqqqqqqqqqqqq> 
    mq> ELSE qq>value-expr qqqj                                       
                                                                      

  (B)0searched-case-expr =                                        
                                                              
  qq> CASE wq> WHEN predicate qq>  THEN qqq> value-expr qwqk  
           mqqqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqqqqj x  
  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  
  mqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> END qqqqqqqqqqqqqqqq> 
     mq> ELSE qqq> value-expr qqqqqj                          
                                                              

  (B)0with-values =                                                  
                                                                 
  qqwqqwqqqqqqqqqqqqqqqqqqqqqqqqqqwq> value-expr qqwqqwqqqq>
    x  tqq> partial_predicate1 qqqj                x  x          
    x  mqq> partial_predicate2 qqqqqqqqqqqqqqqqqqqqj  x
    mqqqqqqqqqqqq , <qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj          

                                                                 

  (B)0partial_predicate1 =                     
                                          
   qwqqq> NOT CONTAINING qqqqqqqqqqwqq>  
    tqqq> NOT STARTING WITH qqqqqqqu    
    tqqq> NOT MATCHING qqqqqqqqqqqqu
    tqqq> = qqqqqqqqqqqqqqqqqqqqqqqu    
    tqqq> <> qqqqqqqqqqqqqqqqqqqqqqu    
    tqqq> ^= qqqqqqqqqqqqqqqqqqqqqqu
    tqqq> != qqqqqqqqqqqqqqqqqqqqqqu
    tqqq> < qqqqqqqqqqqqqqqqqqqqqqqu
    tqqq> >= qqqqqqqqqqqqqqqqqqqqqqu
    tqqq> > qqqqqqqqqqqqqqqqqqqqqqqu
    mqqq> <= qqqqqqqqqqqqqqqqqqqqqqj

  (B)0partial_predicate2 =                     
                                          
   qwqqq> IS NOT NULL qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
    tqqq> NOT BETWEEN qwqqqqqqqqqqqqqqqqwq value-expr AND value-expr qqu
    x                  tq> ASYMMETRIC qqu                              x
    x                  mq> SYMMETRIC qqqj                              x
    tqqq> NOT LIKE qq> <pattern> qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqu
    x                              tq> ESCAPE <escape-character> qqu   x
    x                              mq> IGNORE CASE qqqqqqqqqqqqqqqqj   x
    mqqq> NOT IN qqwq> value-expr qqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqj
                   mq> ( qwwq> value-expr qqwwqq> ) qqj
                          xmq> select-expr qjx
                          mqqqq , <qqqqqqqqqqj

  (B)0function-invocation =                                  
                                                         
  qq> <function-name> qq> ( qwqqqqqqqqqqqqqqqqqwq> ) qq> 
                             mwq> value-expr qwj         
                              tq> DEFAULT qqqqu
                              mqqqqqq , <qqqqqj          

  (B)0uid-numeric-functions =                  
                                          
   qwqqq> UID qqqqqqqqqqqqqqqqqqqqqqqwqq>  
    tqqq> CURRENT_UID qqqqqqqqqqqqqqqu    
    tqqq> SESSION_UID qqqqqqqqqqqqqqqu    
    mqqq> SYSTEM_UID qqqqqqqqqqqqqqqqj    

  (B)0length-value-functions =                                           
                                                                     
   qwqqq> CHARACTER_LENGTH qwq> (char-value-expr) qqqqqqqqqqqqqqwqqq>
    tqqq> CHAR_LENGTH qqqqqqu                                   x    
    tqqq> LENGTH qqqqqqqqqqqj                                   x
    tqqq> OCTET_LENGTH qqqqqwq> (value-expr) qqqqqqqqqqqqqqqqqqqu    
    tqqq> LENGTHB qqqqqqqqqqj                                   x
    tqqq> SIZEOF qqqqqqqqqqqwq> (value-expr) qqqqqqqqqqqqqqqqqqqj
    mqqq> VSIZE qqqqqqqqqqqqj

  (B)0char-value-expr =                                                             
                                                                                
  wq> common-value-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
  tq> <string-literal> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> user-string-functions qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> SYS_GUID ( ) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> UPPER (char-value-expr) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> LOWER (char-value-expr) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> TRANSLATE (char-value-expr qwq>USING <translation-name>) qqqqqqqqqqqqqqqqu 
  x                               mq> , char-value-expr , char-value-expr)    qu  
  tq> CONCAT qqqqwq> (value-expr qwq> , value-expr qwq>  ) qqqqqqqqqqqqqqqqqqqqu
  tq> CONCAT_WS qj                mqqqqqqq<qqqqqqqqqj                          x
  tq> trim-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
  tq> SUBSTRING ( char-value-expr FROM qqk                                     x 
  x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj                                     x 
  x mq> <start-position> wqqqqqqqqqqqqqqqqqqqqqqqqqqwqq ) qqqqqqqqqqqqqqqqqqqqqu 
  x                      mq> FOR  <string-length> qqj                          x 
  mq> char-value-expr qq> || qq> char-value-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
                                                                                

  (B)0user-string-functions =                  
                                          
   qwqqq> USER qqqqqqqqqqqqqqqqqqqqqqwqq>  
    tqqq> CURRENT_USER qqqqqqqqqqqqqqu    
    tqqq> SESSION_USER qqqqqqqqqqqqqqu    
    mqqq> SYSTEM_USER qqqqqqqqqqqqqqqj    

  (B)0trim-expr =                                              
                                                           
  qqq> TRIM qqk                                            
  lqqqqqqqqqqqj                                            
  mq> ( qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk   
         mwqqqqqqqqqqqqwwqqqqqqqqqqqqqqqqqqqwq> FROM j x   
          tq> BOTH qqqqumq> char-value-expr j          x   
          tq> LEADING qu                               x   
          mq> TRAILING j                               x   
  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj   
  mqq> char-value-expr qq> ) qqqqqqqqqqqqqqqqqqqqqqqqqqqq> 
                                                           

  (B)0date-time-value-expr =                                         
                                                                 
  qwq> date-time-value-expr qwq> + qwq> interval-value-expr qwq> 
   x                         mq> - qj                        x   
   tq> interval-value-expr qq> + qq> date-time-value-expr qqqu   
   mq> date-time-value-factor qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj   
                                                                 

  (B)0date-time-value-factor =                                   
                                                             
  qqwqqq> common-value-expr qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
    tqqq> date-time-literal qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
    tqqq> CURRENT_DATE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
    tqqq> SYSDATE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu 
    tqqq> SYSTIMESTAMP qqqqqqwqwqqqqqqqqqqqqqqqqqqqqqqqqqwqj
    tqqq> LOCALTIME qqqqqqqqqu mq> (seconds-precision) qqj   
    tqqq> CURRENT_TIME qqqqqqu
    tqqq> LOCALTIMESTAMP qqqqu
    mqqq> CURRENT_TIMESTAMP qj

  (B)0date-time-literal =                                              
                                                                   
  qqwq> TIME qq> ' qq> time-body qq> ' qqqqqqqqqqqqqqqqqqqqqqqqwqq>
    tq> DATE qwqqqqqqqqqwq> ' qq> date-body qq> ' qqqqqqqqqqqqqu   
    x         mq> ANSI qj                                      x   
    mq> TIMESTAMP qq> ' qqwq> date-body   time-body qwqq>  ' qqj   
                          mq> date-body : time-body qj             
                                                                   

  (B)0time-body =                                  
                                               
  qqq> <hours> : <minutes> :  <seconds> qqqk
     lqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqj
     mwqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqq>
      mq> . <fractional-seconds> qj

  (B)0date-body =                     
                                  
  qqq> <year> - <month> - <day> qq>
                                  

  (B)0interval-value-expr =                                                
                                                                       
  qwwqqqqwwq> interval-value-factor qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwq> 
   xt> + ux                          t> * wq> numeric-value-expr qux   
   xm> - jx                          m> / j                       xx   
   x      mq> numeric-value-expr qq> * q> interval-value-factor qqjx   
   mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq + <qqwqqqqqqqqqqqqqqqqqqqqqqqqqj   
                                 mq - <qqj                             
                                                                       

  (B)0interval-value-factor =                                                
                                                                         
  qwq> interval-literal qqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqw> 
   tq> common-value-expr qqj                                          x  
   mq> ( q> date-time-value-expr q> - q> date-time-value-expr q> ) qk x  
        lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x  
        mq> interval-qualifier qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  
                                                                         

  (B)0date-vms-value-expr =                                   
                                                          
  qqwqwqqqqqqqqqqqqqwq> ' qq> <date-vms-string> qq> ' wq> 
    x mq> DATE VMS qj                                 x   
    mqqq> common-value-expr qqqqqqqqqqqqqqqqqqqqqqqqqqj   
                                                          
Close Help