Xref: alice comp.databases.oracle.misc:19725
Path: alice!news-feed.fnsi.net!news.mich.com!enews.sgi.com!nntprelay.mathworks.com!howland.erols.net!newsfeed.internetmci.com!204.238.120.130!news-feeds.jump.net!nntp2.dejanews.com!nnrp1.dejanews.com!not-for-mail
From: azhan98@tm.net.my
Newsgroups: comp.databases.oracle.misc
Subject: ORACLE-SQL : Sequence Problem (Need SQL GURUS)
Date: Thu, 10 Sep 1998 03:34:23 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 43
Message-ID: <6t7hbv$dse$1@nnrp1.dejanews.com>
X-Article-Creation-Date: Thu Sep 10 03:34:23 1998 GMT
X-Http-User-Agent: Mozilla/4.04 [en] (WinNT; I)
X-Http-Proxy: 1.0 jester.ti.com:80 (Squid/1.1.22), 1.0 x14.dejanews.com:80 (Squid/1.1.22) for client 157.87.93.83, 192.94.94.1

Please advice me on this problem......

I create a sequence say s_mysequence
The sequnce will increment its value by 1.
From my understanding, sequnce will alway increase its value when called.
(Or can we reset the value?).

Here's the problem:
How can I write the code (SQL or PL/SQL or SQL*PLUS)that will increase the
sequence value until it match the value of other parameter value and reset
its value back to 1.

I have to do this since I want my sequnce to be dynamic.
Let say I enter parameter 3

My code will generate some number like this
Whatever-Wharever1-A1
Whatever-Wharever1-A2
Whatever-Wharever1-A3

The next run, if I enter parameter 4, using the same sequence (or is there any
other way? I don't want to create other new sequence every time)
My code will generate some number like this
Whatever-Wharever2-A1
Whatever-Wharever2-A2
Whatever-Wharever2-A3
Whatever-Wharever2-A4

If the sequence is not dynamic and cannot be reset, this is the value
I will get
Whatever-Wharever2-A4
Whatever-Wharever2-A5
Whatever-Wharever2-A6
Whatever-Wharever2-A7

Worst to worst, can I reset the sequence number (is it possible?)
Can anybody give me some ideas..............PLEASE...............

Newbie,
Norazman

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
