Difference between revisions of "SQL Pseudo Columns"

From Recital Documentation Wiki
Jump to: navigation, search
 
m (PSEUDO COLUMNS moved to Pseudo Columns)
(No difference)

Revision as of 09:16, 16 March 2009

PSEUDO COLUMNS

Class

SQL Applications


Purpose

Provide extra information about a SELECT row set


See Also

INSERT, SELECT, UPDATE


Description

A Pseudo Column behaves like a table column, but is not actually stored in the table. You can select from Pseudo Columns, but they cannot be updated. They provide extra information about a row set.


Pseudo Columns Description
CURRVAL The CURRVAL Pseudo Column will return the current sequence number from the specified table. Sequence numbers can be used for primary and unique index keys.
NEXTVAL The NEXTVAL Pseudo Column will return the next unique sequence number from the specified table. Sequence numbers can be used for primary and unique index keys.
ROWID The ROWID Pseudo Column will return a number identifying the row’s physical stored position in the table. The ROWID Pseudo Column can be used to perform singleton selects, or optimize updates of a known ROWID.
ROWNUM The ROWNUM Pseudo Column will return a number indicating the order in which the rows are selected from the table.
SQLCNT The SQLCNT Pseudo Column will return the number of rows affected by the last SQL statement. For example, after a SELECT statement, SQLCNT will contain the number of rows selected.
SQLCODE The SQLCODE Pseudo Column will return a number indicating the result of the last SQL statement.
SYNCNUM The SYNCNUM pseudo column will return the unique sequence number assigned to a row from the specified table.