5 Replies Latest reply on Mar 4, 2013 10:50 PM by CraigB

    how i can re generate  sequence number on record  (form 10g) ?

    ayman hamdan01
      Hi to all

      i have sequence on button when i click he begin generate number 1 , 2 , 3 but if i want delete record like (3) .. how i can re generate this number to begin next number from 3 not from 4 ?

      thanks in advance

      Edited by: ayman hamdan01 on Mar 2, 2013 11:49 PM
        • 1. Re: how i can re generate  sequence number on record  (form 10g) ?
          HamidHelal
          ayman hamdan01 wrote:
          Hi to all

          i have sequence on button when i click he begin generate number 1 , 2 , 3 but if i want delete record like (3) .. how i can re generate this number to begin next number from 3 not from 4 ?

          thanks in advance

          Edited by: ayman hamdan01 on Mar 2, 2013 11:49 PM
          give me an answer ? how can you recover a paper when it's lost by wind ?
          Sequence is not intended to do this, what you want. more also it's not related with this forum.
          ask at {forum:id=75}

          before asking their close it marking as answered.

          Hope this helps

          Hamid
          • 2. Re: how i can re generate  sequence number on record  (form 10g) ?
            ayman hamdan01
            man , i work it on form 10 g and i think this forum is related with my question ! There may be a property of form property palette to this issue or that there is a code write on trigger of the issue without return to database .

            but anyway thank you
            • 3. Re: how i can re generate  sequence number on record  (form 10g) ?
              HamidHelal
              ayman hamdan01 wrote:
              man , i work it on form 10 g and i think this forum is related with my question ! There may be a property of form property palette to this issue or that there is a code write on trigger of the issue without return to database .
              you didn't answer my question.
              Read this..
              1. http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:530735152441
              2. http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4343369880986

              Hope this helps...

              hamid
              • 5. Re: how i can re generate  sequence number on record  (form 10g) ?
                CraigB
                I agree with Hamid on this one. Why does a gap-less sequence matter? Typically, when a sequence is not used as the PK or FK value - it is used to record the order in which a value is added to a record set/table. As long as the order is correct, does it matter if the sequence skips a few numbers? If you are trying to use a sequence as, say the line number of an order, then I suggest that a sequence is the wrong thing to use. I would recommend you use either :SYSTEM.TRIGGER_RECORD or :SYSTEM.CURSOR_RECORD instead.
                There may be a property of form property palette to this issue or that there is a code write on trigger of the issue without return to database .
                There are no properties in Forms for sequences. You have to use a Database Sequence or develop your own algorithm in Forms to generate a sequence without hitting the database. As I mentioned above, you could also use the TRIGGER/CURSOR_RECORD System variable if you don't want to develop your own algorithm.

                Craig...