Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: incrementing function in Oracle

Re: incrementing function in Oracle

From: Markus Stuhlpfarrer <mstuhlpfarrer_at_hollomey.com>
Date: Tue, 03 Jul 2001 11:34:36 GMT
Message-ID: <3B41C9E0.1A2A1619@hollomey.com>

make a sequence:

CREATE SEQUENCE testseq
 INCREMENT BY 1
 START WITH 1
 MINVALUE 1
 MAXVALUE 100000000
 NOCYCLE EVERY time you call the value of the sequence it is raised by one, so be careful with selecting it

Kah-Tat Lim wrote:

> dear all,
>
> need your help on this,
>
> the problem that I am facing is
>
> 1) i have 3 tables (for e.g) i) Card Table ii) Room Table iii) Meeting Table
> 2) what should i do when everytime when a record is to be created in each of
> these tables, i would want to increment a certain field in the tables by 1,
> for e.g
> when a record is to be inserted into Card Table
> the Card ID field is to be incremented by 1, that means if the present
> record in Card Table have the Card ID of 8901, once an insertion of a record
> is to be done in Card Table, the Card ID will have to be 8902.
>
> as i have to prior experience in this before, can anyone help? thanks
Received on Tue Jul 03 2001 - 06:34:36 CDT

Original text of this message

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