Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to Oracle
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00553723
Message ID:
00553747
Views:
8
What I do is I have a LastUpdate column in my Oracle tables. I then use an Insert/Update trigger to populate this column with the SYSDATE. The following is an example Insert/Update trigger:
create or replace trigger ADDRESS_HISTORY_BEFORE_INSUPDT
before insert or update on npdes.ADDRESS_HISTORY for each row
declare
v_Id   Number;
v_User Char(8);
v_Date Date;
BEGIN
 select USER into v_User from dual;
 :new.Updated_By := v_User;
 select SYSDATE into v_Date from dual;
 :new.Last_Update := v_Date;
 If :new.KeyID Is Null or :new.KeyID < 1 Then
    select s_npdes_ADDRESS_HISTORY.nextval into v_Id from dual;
    :new.KeyID := v_Id;
 End If;
End;
/
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform