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!

using mapping variables to generate sequence value

Status
Not open for further replies.

anant13703

Technical User
Apr 9, 2004
10
0
0
IN
Hi All,
IS there a way by which we can generate subsequent numbers without using a sequence generator or oracle sequence. Somthing like...
var2 = :LKP.lkp_abcd......(returns some id number from target table)
var1 = 1000 ...

iff(condition1 = TRUE, var1, var2).

Now if "condition1" is TRUE, then we use var1 value and then have to increment var1 by 1 [(i.e. var1 = var1 +1) so that next time when condition1 is true var1 shhould have value 1001, and this value is passed on..]
...ELSE we use var2 and leave the var1 as it is.

Someone told me this is possible..but that someone is not around rite now.
Will be highly gratefull to the person who can help me out with this trick. Its very urgent.

Regards,
Anant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top