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: Oracle-SQL Problem

Re: Oracle-SQL Problem

From: <edawad_at_my-dejanews.com>
Date: Thu, 10 Sep 1998 05:18:32 GMT
Message-ID: <6t7nf8$n0h$1@nnrp1.dejanews.com>


In article <6t2k2c$cq0$1_at_nnrp1.dejanews.com>,   mansegak_at_my-dejanews.com wrote:
> In Oracle Application,how can I implement this?
>
> 1)I created my own table say MYTABLE
> 2)This table contain few field such as CREATION_DATE,
> CREATED_BY,LAST_UPDATED_DATE, LAST_UPDATED_BY
> etc...etc....(some other fields that necessary)
>
> My question is, how I want to get the "default value to be
> insert" into for this 4 special field everytime the user do
> a DML (Data Manipulation :INSERT/UPDATE) "automatically", ie:
>
> a)CREATION_DATE - Maybe I can default it to SYSDATE (am I correct?)
> b)But how about the rest (CREATED_BY,LAST_UPDATE_DATE & LAST_UPDATE_BY)
>
> I mean, how the system will know it is an update operation (since, if so
> I can use SYSDATE as well for LAST_UPDATE_DATE) in SQL.(How can I implement
> it using SQL statement?)
>
> Can anybody help me on this since I really "blur" on this situation.
>
> Thanks.
> Norazman
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>

Use database triggers.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Sep 10 1998 - 00:18:32 CDT

Original text of this message

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