Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Expressions, 2 of 14


About SQL Expressions

An expression is a combination of one or more values, operators, and SQL functions that evaluate to a value. An expression generally assumes the datatype of its components.

This simple expression evaluates to 4 and has datatype NUMBER (the same datatype as its components):

2*2 

The following expression is an example of a more complex expression that uses both functions and operators. The expression adds seven days to the current date, removes the time component from the sum, and converts the result to CHAR datatype:

TO_CHAR(TRUNC(SYSDATE+7)) 

You can use expressions in:

For example, you could use an expression in place of the quoted string 'smith' in this UPDATE statement SET clause:

SET last_name = 'Smith'; 

This SET clause has the expression INITCAP(last_name) instead of the quoted string 'Smith':

SET last_name = INITCAP(last_name);

Expressions have several forms, as shown in the following syntax:

expr::=


Text description of expressions14a.gif follows
Text description of expr

Oracle does not accept all forms of expressions in all parts of all SQL statements. You must use appropriate expression notation whenever expr appears in conditions, SQL functions, or SQL statements in other parts of this reference. The sections that follow describe and provide examples of the various forms of expressions.

See Also:

The individual SQL statements in Chapter 8 through Chapter 17 for information on restrictions on the expressions in that statement 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback