Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

autonumber

Status
Not open for further replies.

huBBLe

Programmer
May 15, 2001
50
SG
what is the equivalent of the autonumber of Access in Oracle? dun think there is rite?

so how do i generate a running number that is juz +1 bigger than the previous one?
 
Use a database trigger which populates the auto-number from a sequence e.g.

CREATE OR REPLACE TRIGGER FUND_SERIES_TYPE_PK_AUDIT
BEFORE INSERT
ON FUND_SERIES_TYPE
FOR EACH ROW
-- PL/SQL Block
begin
select fund_series_type_seq_1.nextval, user, sysdate
into :new.fst_num,
:new.update_userid,
:new.update_timestamp
from dual;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top