Skip to Main Content
SQL in a Nutshell, 3rd Edition
book

SQL in a Nutshell, 3rd Edition

by Kevin Kline
November 2008
Intermediate to advanced content levelIntermediate to advanced
591 pages
17h 28m
English
O'Reilly Media, Inc.
Content preview from SQL in a Nutshell, 3rd Edition

Built-in Scalar Functions

ANSI SQL built-in scalar functions identify both the current user session and its characteristics, such as the current session privileges. Built-in scalar functions are always nondeterministic. The CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP functions listed in Table 4-3 are built-in functions that fall into the date-and-time category of functions. Although the four platforms discussed in this book provide many additional functions beyond these SQL built-ins, the SQL standard defines only those listed in Table 4-3.

Table 4-3. ANSI SQL built-in scalar functions

Function

Usage

CURRENT_DATE

Returns the current date

CURRENT_TIME

Returns the current time

CURRENT_TIMESTAMP

Returns the current date and time

CURRENT_USER or USER

Returns the currently active user within the database server

SESSION_USER

Returns the currently active authorization ID, if it differs from the user’s ID

SYSTEM_USER

Returns the currently active user within the host operating system

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Effective SQL: 61 Specific Ways to Write Better SQL, First Edition

Effective SQL: 61 Specific Ways to Write Better SQL, First Edition

John L. Viescas, Douglas J. Steele, Ben G. Clothier
SQL in a Nutshell, 4th Edition

SQL in a Nutshell, 4th Edition

Kevin Kline, Regina O. Obe, Leo S. Hsu

Publisher Resources

ISBN: 9780596155322Errata Page