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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generate a sequence number

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
0
0
US
I need to generate a sequential number. NOT using an oracle sequence.

I have a form with an employee record as the master record. Employee Addresses as the child records. I have a column in the addresses called seq_num. The first address should be seq_num = 1, the second address should be seq_num=2 etc. I need something in a trigger, maybe a pre-insert trigger on the child data block, that does something like a

SELECT MAX(SEQ_NUM) + 1 FROM DETAIL,
MAIN
WHERE
DETAIL.ITEM_ID=MAIN.ITEM_ID
AND
GC_TAG_UPGRADE_DETAIL.ITEM_ID = :mytarget

any suggestions about how to generate this number on a form would be appreciated...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top