Difference between revisions of "PSEUDO COLUMNS"
From Lianjapedia
Yvonne.milne (Talk | contribs) (Created page with '==Purpose== Provide extra information about a SELECT row set ==See Also== INSERT, SELECT, UPDATE ==Description== A Pseudo Column be…') |
Helen.george (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
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. | 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. | ||
− | {| class="wikitable" | + | {| class="wikitable" width="100%" |
− | !Pseudo Columns||Description | + | !width="15%"|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. | + | |valign="top"|[[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. | + | |valign="top"|[[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. | + | |valign="top"|[[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. |
|- | |- | ||
− | |[[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. | + | |valign="top"|[[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. | + | |valign="top"|[[SQLCODE]]||The SQLCODE Pseudo Column will return a number indicating the result of the last SQL statement. |
|- | |- | ||
|} | |} | ||
Line 25: | Line 25: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL|Pseudo Columns]] | [[Category:SQL|Pseudo Columns]] | ||
− |
Latest revision as of 09:04, 5 February 2013
Purpose
Provide extra information about a SELECT row set
See Also
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. |
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. |