Sequence behavior

Hi All,
I have come across one strange behavior of sequence in Oracle 11g R2. Could anyone please account for the change. I have posted the simulation scripts as below.
----Created a new sequence------
CREATE TABLE JO_SEQ_TEST (A NUMBER);
----Created a new table------
CREATE SEQUENCE JO_sEQ_1 START WITH 1;
----Populating the table with the sequence values------
DECLARE
M NUMBER;
BEGIN
FOR I IN 1..10
LOOP
DBMS_OUTPUT.PUT_LINE('Loop Count:'||TO_CHAR(i));
INSERT INTO JO_sEQ_TEST VALUES (JO_SEQ_1.NEXTVAL) RETURNING A INTO M;
DBMS_OUTPUT.PUT_LINE('Inserted value:'||TO_CHAR(M));
END LOOP;
END;
---block output-------
Loop Count:1
Inserted value:2
Loop Count:2
Inserted value:3
Loop Count:3
Inserted value:4
Loop Count:4
Inserted value:5
Loop Count:5
Inserted value:6
Loop Count:6
Inserted value:7
Loop Count:7
Inserted value:8
Loop Count:8
Inserted value:9
Loop Count:9
Inserted value:10
Loop Count:10
Inserted value:11
SELECT * FROM JO_SEQ_TEST;
2
3
4
5
6
7
8
9
10
11My question is that why the records are inserted starting with 2, and not with 1. How the sequence value 1 is missing during insertion?
If I try with alternative way, by holding the sequence value in another local variable, then inserting into the table, it works fine. Like below
---------after recreating the table and sequence------------
DECLARE
M NUMBER;
BEGIN
FOR I IN 1..10
LOOP
DBMS_OUTPUT.PUT_LINE('Loop Count:'||TO_CHAR(i));
M:= JO_SEQ_1.NEXTVAL;
INSERT INTO JO_sEQ_TEST VALUES (M);
DBMS_OUTPUT.PUT_LINE('Inserted value:'||TO_CHAR(M));
END LOOP;
END;
----block output-------
Loop Count:1
Inserted value:1
Loop Count:2
Inserted value:2
Loop Count:3
Inserted value:3
Loop Count:4
Inserted value:4
Loop Count:5
Inserted value:5
Loop Count:6
Inserted value:6
Loop Count:7
Inserted value:7
Loop Count:8
Inserted value:8
Loop Count:9
Inserted value:9
Loop Count:10
Inserted value:10

It appears that this is documented behavior:
http://stackoverflow.com/questions/4153807/oracle-sequence-starting-with-2-instead-of-1
(google rocks).

Similar Messages

  • Sequence behavior after importing via DataPump

    Hi Friends,
    I'm running Oracle DB 11.2.0.3 on Windows 2008 R2 SP1 Servers and I faced a strange sequences behavior after importing a schema via Data Pump.
    The export is done this way:
    EXPDP userid/password dumpfile= logfile= directory= remap_dumpfile=y (no news)
    The import is done this way
    IMPDP userid/password dumpfile= logfile= directory= remap_schema=(old_one:new_one) remap_tablespace=(old_ones:new_ones, so on...)
    The import works fine. There are no errors and the sequences are as well imported with no warnings.
    The strange behavior is that the sequences seems to "reset". When we call a sequence the NEXTVAL is just lower than the values already stored in the Database, and we get ORA-00001 a lot. The sequence should know that vale. I don't have this problem when using exp/imp, just via DataPump.
    So that when we create an order that should receive the value of 100, as an example, because we have 99 orders on the system, Oracle suggest a value lower than 99 or even the number one value (01).
    We then wrote a script to check the CURVAL of the sequences on the base schema to recreate the sequences using this initial value on the new imported schema.
    Does anyone faced this problem before?
    Any suggestions?
    Tks a lot

    Richard
    I've tried what you just said.
    Adding the parameter consistent=y makes Oracle to show a message like that at the beginning of the export
    "flashback_time=TO_TIMESTAMP('2013-09-03 12:18:12', 'YYYY-MM-DD HH24:MI:SS')"
    It warns me: Legacy Parameter CONSISTENT=TRUE, and replaces with flashback_time.
    Really, I did not know about this behavior with this "old" parameter. I'm very appreciated about your help.
    I was almost thinking it was a DataPump bug or something.
    Thanks a lot Richard. I'll now update my scripts and make lots of test.
    If you have more advices using this parameter please share us.
    Cheers

  • Sequence Behavior - not clear

    Hi,
    I cannot understand the behavior of this sequence
    CREATE SEQUENCE NS5;
    ALTER SEQUENCE NS5
    INCREMENT BY 10;
    SELECT NS5.NEXTVAL FROM DUAL;
    Why is the first value being generated : 10
    The default start with value is 1, why isn't 1 displayed.
    Thanks for your responses in advance.

    >
    Why is the first value being generated : 10
    The default start with value is 1, why isn't 1 displayed.
    >
    That is by design - SEQUENCEs are documented to produce the behaviour that you experienced.
    See ALTER SEQUENCE in the SQL Language doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10592/statements_2012.htm
    >
    •If you change the INCREMENT BY value before the first invocation of NEXTVAL, then some sequence numbers will be skipped. Therefore, if you want to retain the original START WITH value, you must drop the sequence and re-create it with the original START WITH value and the new INCREMENT BY value.

  • Text Sequence Behaviors (Continuous) - Intermittent

    Hi everyone! I'm not exactly sure what I'm doing wrong. I'm trying to apply the text sequence behaviour under the continuous menu called Intermittent. Applying this to my text produces two behaviors - Intermittent and Randomize Sequence Custom Speed. When I hit play, absolutely nothing happens. I can see the custom speed control in the Intermittent behavior jump up and down, but that's about it. What do I need to do to produce that cool flickering effect I see in the effect's preview window?
    I should note that all the other continuous effects seem to work without touching anything.

    It should work with the default settings when you apply the behavior. It is active for me upon application.  The fact you see the custom speed control moving indicates the Random sequence custom speed behavior is operative. You might play with the opacity and variance controls to see if that jump starts it. Also I would delete the behavior and reapply it just in case it didn't apply correctly. Is Motion acting strangly in any other way?

  • Missing Text Behaviors

    I think I'm missing some behaviors. I only have the Text animation behaviors come up but none of the test sequence behaviors... Any Ideas?

    trash your motion preferences?
    adam

  • Behavior missing?

    I've looked all over Motion 4 for the "fall" text behavior and can't find it. Any suggestions?

    The text engine was redesigned in Motion 4 so all the behaviors had to be revised. You'll have to see if one is similar or simply build your own with the text sequence behavior.

  • Text Behaviour Sequence Controls

    I'm animating paragraphs of text in Motion2, which I want to slide in line-by-line from the left of screen.
    The "Slide In From Left" behaviour in the "Text-Move" category work well, EXCEPT, when I change the select sequence control from "All" to "Line" it animates out before animating in.
    I thought about offsetting the behaviour so you only see the second half of the animation, but I want the spread sequence control greater than 1, so the out animation is not finished before the in animation starts.
    Is there a way of getting it to animate in one direction only, a line at a time?
    I don't really want to have to do the whole lot by hand (motion paths) as I have LOADS of text to animate.
    Thanks for any suggestions

    This is one of the annoying aspects of the text sequence behavior - if you don't us "all" for the Select parameter, it goes to the value you specific and then back again - I really wish it worked like the Replicator, which gives you several options for how to move through the animation: to, from, through, through inverted - much better.
    You can set the Traversal parameter to Custom and then keyframe the Location parameter that appears - from 0% at the beginning of the behavior to 100% at the end - but you then need to add a mask to hide the lower lines that show up briefly due to the Spread being at 1 or greater. Pain in the neck. Would love it if someone found at way around this.
    Mark

  • Dashed Line - Dashes Move?

    I'm trying to make a dashed line move, sort of like what you see in photoshop when you outline something. Basically I want the dashes to move along a path.
    Usually I can come up with these solutions pretty quickly, but I'm not able to on this one. Maybe I'm not as versed in the "shape" behaviors as I should be.
    Originally I thought I could just ramp the offset of the dashes, but that's not an option. I'm hoping I don't have to make a movie of a dash moving left to right, and use that as the source of my pen. That seems a little intensive, but may work.
    Anyone have a quick idea on how this should be done?

    Adam:
    That's helpful, but I'm trying to get the dashes to actually move (all of them) along the path, like in a loop. Like marching ants on a path. As one disappears on the end, another will come on at the start. You know?
    The replicator is a good idea, but I can't get the sequence behavior to follow the path. It only allows the position to be an xyz point.
    Using Motion Path wont allow me to align the angle.
    I feel like I should use the shape behaviors, but that won't allow me to move anything along the path, much like the limitation with the replicator.
    I keep feeling like there should be an offset that I can move, but there isn't.
    I'm seriously thinking I need to animate one dash moving left to right and make that the source of the brush. Right?

  • Text transitions, 3rd party plug-ins, etc.

    This seems so simple, but I cannot find it anywhere. I am using motion to create moving pictures and text. I want the text to blur in and out slowly (all of the letters at the same time). I found the text sequence blur but the letters will only be in sequence like left to right or random, correct? I have looked for 3rd party plug-ins but can't find anything as simple as a transitional blur for text. Any suggestions?
    Thank you!!

    You can modify any of the text sequence behaviors in any way imaginable. Try increasing the Spread value to spread out the animation. Or, just add a blur filter to the text and keyframe the blur amount to change over time.

  • Importing Text and Animating

    Hi,
    I've got an excel file with a list of 200 names. I need to end up with these 200 names randomly fading in and out (over the course of 1-2 minutes) and possibly with some type of random animation or behavior to make the whole effect appear interesting.
    Please share any ideas about how to achieve this, other than dealing with each name individually. I don't understand Motion enough to know if there is some way to import the list and have this all happen automatically.
    Do I really need to deal with each name separately?
    Thanks for any help?
    Matt

    If you arranged it to have one name per frame, you could do a clone layer of that, then use a replicator on the clone layer with a random fill and use the Sequence behavior to fade the names in and out...
    Patrick

  • How to Run sequencially two Key-Commit triggers with different scope

    Hi all
    I have two Key-Commit triggers at form and Block level. Form level trigger is inherited from a library. In block level trigger, I have some additional checks. What I want is, to execute the Block level trigger first and than the form level. I tried working with the override/Before/after property of triggers which does the job of sequencing execution but the Raise Form_Trigger_Failure in the block level trigger doesn't stop the execution of form level trigger. Block level trigger does the checks and display corresponding alerts but than the form level trigger also executes.
    I don't wanna copy the code from Form level trigger to the block level trigger as it is common to whole application and may need some additional coding/ bug fixing later.
    Any help would be appreciated.
    RMA

    Thanks for all the help.
    In Key-Commit trigger I am just setting the Blocks' properties, nothing special, the main checks are in On-Commit trigger. I also understand the work around by using a user defined trigger but, to my knowledge, Oracle doesn't recommend it.
    My form has two datablocks, Parent and a child. The entered quantity in the Master block needs to be verified against the Number of units entered in the child block. If they are not the same, I want the alert and stop execution.
    Now I am using Pre-Insert trigger in the master block but was a little surprised because of the sequencing behavior. My understanding was that RAISE FORM_TRIGGER_FAILURE stops execution of all the code after it even is it is in another trigger/procedure ..but now it appears that I was wrong :-(
    Any suggestions??
    RMA

  • Crashed like an Art, see photo

    The text layer was built up days ago (only one), with a Sequence Behavior, Spread was set to 17, was playing OK at the beginning, started to crash or freeze last night, just couldn't touch it again, check photo, http://zmupicture.com/screen.jpg
    This MacPro 2.8GHz 8 Cores only 3 weeks old with stock Graphic card, 6G Ram, Activity Monitor shows 95% CPU idle, less than 2G Ram used when crashed. In FCP6, it shows "Out of Memory" when 95% CPU still idle. All imported .mov from Motion played very slow (HDV File), need render. VisualHub encoding was VERY FAST, it was using 40-60% of CPU! Why not FCP and Motion?
    Tested Hardware, normal, Disk utility shows normal.
    Any tips appreciated!
    Mu

    Hmm. I don't think you should be using HDV to edit in. It's a really compressed format. I'd suggest using ProRes if at all possible.
    I have also gotten a similar screen, and think it's a graphics card glitch of some kind, but I'm not sure.

  • I want to create a tail that behaves like a string

    I want to create a tail and fasten one end to an object. The object is translating and has a small amount of rotation oscillation. I want the tail to behave like a string that has very little stiffness. It should curve from side to side as the object oscillates. I could probably figure this out by experimentation but I would much appreciate assistance.

    Well, I don't know what you mean by "the object is translating", but to make a tail that behaves with a lot of curve, it needs to be comprised of segments. I would go with a replicator of a bunch of circles and then use the replicator sequence behavior to animate the curvature.
    Andy

  • Viewing Folios on a Kindle Fire

    Res Ipsa Loquitor
    -The thing speaks for itself. The title of this post, I mean. I'm having trouble with my Kindle Fire...OK, if I have to explain it, then I suppose the thing doesn't speak for itself. I suck at Latin.
    It's great to see that the Adobe Content Viewer is in the Amazon App Store. I Installed it. Nice. And while I thouroughly expected to have to make two, if not three versions of my book for iPad / Android / Kindle Fire, what I'm seeing is totally not what I expected. Even a simple page with a small image sequence and a jpeg don't load.
    Will anyone comment on their success or failure viewing Folios this way? Or is there a new workflow that I just don't understand.
    Undying gratitude, &c ,&c, &c.
    Dan

    I have the luxury of an iPad, and Xoom, and a Fire cheerfully coexisitng side by side by side, and the one version of my project works exactly as expected, and basically identical* on both iPad and Xoom, heck, even onmy Android phone, but really unexpectedly diferent on Fire. I suppose I'll make a new folio and scale the entire artboard down to exactly match the Fire's screen and see what that looks like. Comments still welcome, though.
    *http://forums.adobe.com/thread/947316 ( see discussion on iPad versus Xoom regarding image sequence behavior)
    Happy three day weekend if you get one.
    Dan

  • Multiple tasks in sequence text behavior don't seem to work..

    Hey guys,
    This is a little frustrating: all I'd like to do is have text type on red and then fade to black.. how would this be accomplished with the sequence text behavior? I don't get what I'm missing. (I'm using Motion 4)

    I'm not totally clear based on your description and choice of using the sequence text behavior what you're going for, but here's what I'd suggest.
    Create the text, set the face color to red. Apply the Type On behavior and adjust the duration as needed to type the text on. If you want all the text to fade at once, then use the fade in/out behavior with no fade in, and fade out over the frames needed. If you want the fade out to be sequential (like the type on, but in reverse), apply the Sequence Text behavior, set the in point for the behavior where you want the fade to start. Add the Face>Opacity parameter and set the value to 0%. Set the Sequencing Parameter as "To".

Maybe you are looking for

  • Can not clear transition in MBP

    I have a portable hard drive with a FCP 5.1.2 project on it. Most of this work is was done on an iMac G5. I can delete a cross dissolve transition just fine. However when I have this same project file running the same version of FCP on my Intel MBP,

  • NEW SOLUTION TO UR MISSING CONTENT OF LOGIC STUDIOS  EXS24 and others...

    hi folks...you're be suprise i've dunn possibly EVERYthing to ressurect the missing contents of EXS24 and other sounds thats has been gone due to installation of Logic Studio...Now for those who transfer there LP7 to the LS8 songs sumtym get no strin

  • New at PSE 7

    I am a total novice and have recently aquired PSE 7.  I am trying to also learn more about photograpy in hopes of having a side gig of a band photographer. Does anyone have any really good tips for someone like me who will be taking alot of on stage

  • SQL Loader: double quotes inside double quotes

    Hello, I need to find a solution for loading some data that contains double quotas. The csv contains data like: "1";"Name1";"Name2" "2";"Name3 "another thing here"";"Name4" "3";"Name33 "thing here"";"Name "name" Name" The data inside the " " must be

  • Error -61 with FTP Write permissions error; Not a publisher

    Hi, I am trying to use Safari to FTP with my schools server (FreeBSD) but when I try to delete something I get error -61 which is FTP Write permissions error; Not a publisher. When I select "Get Info" I see the permissions say "You can only read". Ho