Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP to Oracle
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00553723
Message ID:
00553747
Vues:
7
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform