Showing posts with label Pseudo column in SQL. Show all posts
Showing posts with label Pseudo column in SQL. Show all posts

Thursday, November 8, 2012

PSEUDO COLUMN in SQL

pseudo-column is an Oracle assigned value (pseudo-field) used in the same context as an Oracle Database column, but not stored on disk. SQL and PL/SQL recognizes the following SQL pseudocolumns, which return specific data items: SYSDATE, SYSTIMESTAMP, ROWIDROWNUMUIDUSER, LEVEL, CURRVAL, NEXTVAL, ORA_ROWSCN, etc.


1) Pseudo columns behave like a table column, but it is not actually stored in a table.

2) Upon pseudo columns only select statements can be implemented. Insert, delete,update cannot be implemented.

Currval, (can be used in set clause of an update, values clause of an insert)

Nextval, (can be used in set clause of an update, values clause of an insert)

Level, Rowid, Rownum.


Download here PDF on Pseudo column and functions in SQL


SQL> SELECT sysdate, systimestamp FROM dual;
SYSDATE   SYSTIMESTAMP
--------- ----------------------------------------
13-DEC-07 13-DEC-07 10.02.31.956842 AM +02:00



SQL> select ename, ORA_ROWSCN, SCN_TO_TIMESTAMP(ORA_ROWSCN) from emp where empno=7369;
ENAME      ORA_ROWSCN SCN_TO_TIMESTAMP(ORA_ROWSCN)
---------- ---------- ----------------------------------------------------------------
SMITH         2113048 20/12/2008 16:59:51.000