Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Pseudo Columns and Functions

Re: Pseudo Columns and Functions

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 18 Nov 1999 08:40:56 -0500
Message-ID: <fwE0OAgGlVIIzr3kQtG3x1RaY9I0@4ax.com>


A copy of this was sent to Dan <dan_at_help.now> (if that email address didn't require changing) On Wed, 17 Nov 1999 15:51:50 -0800, you wrote:

>How would you describe the difference between a Pseudo column and a
>function to a new oracle user.
>
>select sysdate from dual;
>
>and
>
>select my_sequence.nextval from dual; (no cache)
>
>both look/act like functions, don't they?
>
>Tia
>
>david

my_sequence.nextval is a psuedo column. You *need* a table to have a sequence. A psuedo column relies on a table existing to derive its value. You cannot have a rowid with a table (another psuedo column). You can have a USER without a table (a function, not a psuedo column).

SYSDATE is not a psuedo column. -- you don't need a table to have a DATE.

Here is a fairly generic way to decide if something is a psuedo column:

   begin

      x := THAT_THING;
   end;

in plsql -- it is a psuedo column. eg: you cannot say:   

   begin

      x := rownum;
   end;

so rownum is a psuedo column. You can say:

   begin

      x := UID;
   end;

so UID is a function. DECODE would be one of the exceptions to this rule of thumb as decode is really a function but a function that must be called from SQL (since the sql runtime engine is the place where decode is compiled into and they did not import that function into the plsql engine).

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Nov 18 1999 - 07:40:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US