Autonumber in a Sequence after Export/Import

Hi,
I have a sequence running in a DB, which increments an ID field. The problem comes up, when I need to backup/restore the DB. What I need then is a SQL script, which would allow me to set the MinValue to the max used value +1 (or + 100). Unfortunately something like
Create Sequence XXX.Mytable
Increment by 1
MinValue (SELECT MAX(COUNTERID) from XXX.Mytable);
MaxValue 1E+27
Cache 20;
does not work. So what is best practise to handle this case. I found many people posting this question, but no simple answer. Does anybody have one?
Thank you in advance
Pawel

Hi Pawel,
I would suggest creating a SQL Procedure and construct a string that would create the sequence and then use EXECUTE IMMEDIATE to create the sequence. Something like:
DECLARE
vMaxID NUMBER(10,0);
vSQL VARCHAR2(1000);
BEGIN
SELECT MAX(COUNTERID) INTO vMaxID FROM MyTable;
vSQL := "CREATE SEQUENCE COUNTERID_SEQ MINVALUE " || TO_CHAR(vMaxID) || " MAXVALUE 99999999999999999999999 INCREMENT BY 1 START WITH " || TO_CHAR(vMaxID) || " NOCACHE NOORDER NOCYCLE;
EXECUTE IMMEDIATE vSQL;
END;
Regards
Andy

Similar Messages

  • FCP 7 lost sequence after exporting - auto save vault not working

    I started a project a couple of days ago. Today I worked from 11.00 - 20.00 hrs. I exported at 20.00 hrs. to compressor (i got a self contained compressed .MOV file out of that pffff)
    But then, returning to FCP 7, the sequence I exported (and worked on all day) was completely empty. Everything in the project folder is still there, but the cuts / edits in the main sequence i worked on are all gone.
    Inside the Auto Save Vault are only four saves from between 11.00 - 11.30 hrs. (not properly every 5 min.) and one from 20.00 hrs. The one from 20.00 hrs. is a version that also has the empty sequence. The whole afternoon FCP 7 seems to have made no auto saves, even though i set the Auto Save Vault to "every 5 min." in the preferences. Auto Save Vault files (of this same project) from a couple of days earlier are all there inside the Auto Save Vault folder.
    Tried already:  Looked inside the other two locations where i have autosave folders of other projects but the files were not there either.
    Had a Tiff in the sequence, and a couple of very simple text-motion things.
    Can anybody tell me whats going on?
    And if there is a way to retrieve?
    Never had this before, is this a FCP7 Yosemite issue?
    Thanks in advance!

    could be a yosemite issue.  Hard to know.  fcp was never meant to work in Yosemite, so it's hit or miss.
    Autosave misbehavior can happen and resetting your fcp preferences usually solves the problem.  Digital Rebellion makes a great utility to reset your preferences (and it's free). 
    www.digitalrebellion.com

  • Audio falls out of sync with FCP sequence after export from STP

    Hey all,
    editing sound on a short film. sent FCP sequence to sweeten the dialog and add effects, according to the timeline it is the same length as sequence length in
    FCP, but when exporting from STP to FCP to complete movie, the sound ends up being about 10 frames longer than the video and starts in sync and falls out of sync over the duration of the film.
    Have tried changing preference settings in STP, exported about 5 ways to breakfast and all have same result.
    Anyone have a solution to this problem?
    Much thanks,
    Holly

    I just experienced this same thing, and as Christof says, it had to do with 'Easy Setup' and 'all formats'. I've been editing a picture shot on RED in Apple ProRes 422 (HQ) at 2K (2048 x 1152) and 24fps...FCS 3 (FCP 7 latest version). Whenever you trash preferences or start up FCP new, you get the 'easy setup' menu. Previously, I could just hit 'okay' and go ahead into FCP and change the settings/resolutions within the project...even if the 'easy setup' default was, say, DV/NTSC 29.97. Also, when opening up an active project after trashing prefs, the project itself would still have the same editing/playback settings/resolutions, even if the 'easy setup' window had its default DV/NTSC setting. Plus, if you create a new timeline and its default is one format, once you drop a different format into it, it asks you if it should adjust to that format anyway, and of course, you say yes and everything is fine.
    Well....in this most recent FCP update, whenever I'd export an AIFF from the timeline and reimport....or if I'd just import an AIFF...it would do something to the playback rate of that newly imported/reimported sound file and suddenly its sync has drifted all over the place within just a minute or so. But strangely, it wouldn't do it to audio that's attached to picture (.mov/MP4/etc.)....only isolated audio files (AIFF/WAV). So naturally, I wondered if something was going on during the export process or the like.
    The solution is to make sure that when you open FCP (newly, or after trashing prefs), make sure you pick the settings/format/framerate in that 'Easy Setup' window that matches what you intend to edit as closely as possible. In my case, the format is Apple ProRes 422 (HQ), 2048 x 1152 @ 24fps, and I use a Blackmagic Multibridge so I have settings for it. Hence......*Format; HD, Frame Rate: 24, Use: Blackmagic HDTV 1080P 24 - 10 bit.* Whereas the default upon startup is....Format: (all formats), Frame Rate: 29.97, Use: DV/NTSC 48KHz.
    You can also set these in the 'Audio Video Settings' menu. Now, whenever I export and reimport an AIFF, or just import an AIFF (like the soundmix prepared by our sound designer), sync stays and there's no drift. So make sure you've picked the right settings when starting or reopening a project, again as Christof pointed out.

  • Reset sequence after data import

    Hi all,
    I've got a problem where we import data into a table with an auto-incremented field for a primary key. After the data import, I can drop the sequence, check the max(primary key), and re-create it to start at the max value + 1. My problem is that I need to do this for a large number of tables and don't know how to write a script to do it. In the Create Sequence command, whenever I try to use a variable in the "START WITH" clause, I get an error.
    Thanks in advance,
    Raymond

    Spool sequence creation scipt result in a file and then run it.
    Or use dynamic sql.
    Or You can "drive" sequence forward issuing select myseq.nextval from dual; apropriate times. If You need "drive" sequence backwards alter it with increment -1, issue select myseq.nextval from dual; apropriate times and alter it with previous increment.

  • Colors are screwed up after export / import h264/avc

    Assume we have created some raw colors with AE. And exported the file with h264/avc codec (see the picture).
    I understand that exporting with chroma 4:2:0 can change the colors a little. It's ok. We play the file with local video player, RGB values are 1-2% away from original, it's not critical.
    But what I don't understand is - why re-encoding the file to h.264/avc with Adobe Media Encoder as standalone application leaves all the colors 100% correct, but if I will import the file to Premiere or AE, colors are visibly screwed up?
    Then export composition to h264/avc with the same settings as stand alone encoder and the colors are screwed up one more time by 1-2%!
    Am I doing something wrong? How to keep the colors when importing?

    Either the good old H.264 Gamma problem or simple quantization errors which you might probably avoid by working in 16bpc or 32bpc. Also keep in mind that AE can use color management and you may already see those differences when setting the comp viewer proofing to you monitor profile. Generally, though, such color issues are extremely difficult to track down. Things like your graphics hardware's acceleration features, VLCs selected decode method, color profiles and other color tweaks can influence this, both in mere perception of colors as well as actually skewing them. Start by working in higher bit-depths when re-importing files into AE and tippi-toe your way to the aforementioned color management stuff and so on...
    Mylenium

  • Editing contacts in gmail after export/import from Palm Desktop is a messy affair

    So far, from what I can see, my contacts are synchronizing well between the Pre and my gmail contacts list.  Being easily amused, I guess it's pretty slick the way it works.  But exporting them from Palm Desktop and importing them into the gmail contacts list was just a jumbled mess.  Almost none of the actual fields from PD mapped correctly to the gmail fields, so all of my info got lumped into the "notes" field in gmail.
    It's easier and faster to edit them in gmail than on the Pre, so that's what I've been doing...fixing about 300 contacts one at a time.  You can cut/copy/paste the info from the notes field into the correct data field.  But there's one really weird thing that happens if you try to drag-and-drop info, say a telephone number or an address, from the notes field into its own field above.  The data appears to move over.  But once you save the change, anything you dragged into its own field disappears.  Trying to go through the list quickly, I didn't notice this strangeness until I had gone through a large enough number of my contacts to really make me swear.
    Post relates to: Pre p100eww (Sprint)
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

    smkranz,
     I had a similar mess to clean up.  I figured that Google's contacts would work better with an import from Outlook and a direct export from Palm Desktop 4.x or 6.x.  I used Chapura's Pocket Copy to push my Palm Desktop 4.2 data into Outlook, and then exported my data from Outlook and into Google contacts.  I followed Google's directions for that part.  I still had to review my 400 or so contacts and do some mop up, but it wasn't a total train wreck.
     Glad to hear that you did get a Pre.  Welcome to the club.  Now we have to work on WyreNut.  
    Alan G

  • Premiere Pro CC 2014 remove my video layers from sequence after export Media Encoder.

    Every time I send the seq to Media Encoder, Premiere Pro hides my video layers and leaves only the audio layers. When I restart the project the workspace is messed up and I have to reset it. Do you guys know what is going on ?

    Yes known issue.
    Make a new project and drop this one into it.
    See if that will help

  • Can data pump handle export/import of a sequence explicitly?

    Is it possible to just export/import a database sequence explicitly using data pump.
    I know we can export/import sequence by exporting/importing the user in which it is defined.
    However I am looking for a way to export/import individual sequnces without having to export/import the entire user.
    Thanks

    Hi, you can use the INCLUDE clause into expdp command, with this option you can specified the object for the export and import process. You can review the next documentation for more information about this topic.
    <br><br>
    INCLUDE
    <br><br>
    Regards.

  • Sequence nextval after an schema level export import

    If I export a schema that has some sequences and then truncate tables and then import the schema, do I get theh old sequence values?
    I guess my question is do sequences get stored at the schema level or the database level.
    I noticed that sequences are exported at the schema level when I do an export so that may be the answer but your confirmation would be appreciated.

    Hi,
    Nothing to worry,imp/exp does not change the value of Nextval.you can use truncate table after exp, then u can import it.
    Regards
    Vinay Agarwal
    OCP

  • Audio and video out of sync after exporting sequence

    I'm a FCP user since years, but not so common with HD footage. Therefore I have an issue with my finished edited movie after exporting: Video and Audio are out of sync.
    My sequence settings are: HDV1080i50, 25fps, 48kHz, 16bit, Stereo. I used File-> Export-> Quicktime Movie -> Current Settings
    Sequence has a duration of 61 minutes and 38 sec. I tried to find out where's the problem and exported audio and video seperated. This results in:
    Video is 61 minutes and 27 sec long
    Audio is 61 minutes and 38 sec long
    That means exported video is shorter than original sequence.
    What could that be ?

    I had the same problem with a Panasonic camera, even filming at 30 fps. I was able to fix it; see [this thread|http://discussions.apple.com/thread.jspa?threadID=1783029&tstart=0]. It's a frustating problem, to be sure. You might have to use Easy Setup a couple times before you get things to work properly. Not sure why that's the case.
    Good luck!
    Message was edited by: Anthony M Kassir MD

  • CC 2014 trial. MPEG MOVIE clips flickering on my time line! after render, and after export. tried all kinds of sequence settings,taking out transitions and effects ,even the audio tracks.....still flickering. They play fine outa the project files!?  HELLL

    CC 2014 trial. MPEG MOVIE clips flickering on my time line! after render, and after export. tried all kinds of sequence settings,taking out transitions and effects ,even the audio tracks.....still flickering. They play fine outa the project files!?  HELLLLLPPPPP!!!!

    We can not see your computer, your settings or even know what your source files are because we are not in the same room as you are!
    We cant see what you are doing wrong ...so you will have to tell us a lot more and show us some screen grabs of your settings.

  • Export-import task sequences between UAT-PROD environments

    Hi,
    What 's your idea of exporting-importing task sequences between UAT-PRD SCCM 2012 servers
    It would save me quite some time but I guess the files and folders, applications (if I would export them too) are kept somewhere in a general folder so that's not so neat ....
    J.
    Jan Hoedt

    Hi,
    You can export it without Content and the copy the content manually. If you have exactly the sam ename and disk layout on prod and uat there will be no editing required. Otherwise you need to change the package source for all packages referenced, this can
    of coourse be scripted.
    If you export it with the content the content will end upp in a structure based on the uniqie idea of the content.
    Using a shared package source could be one solution as well.
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • I am working on Premiere 6.5. why does my vid seem out of sequence and jumpy after exporting it as an avi?

    I was near completion of an edit when my mother board died. I transfered the project over to my laptop, premiere could no longer read the source avi file that i was editing from. upon inspection I discovered that the avi file had becone corrupt and would no longer play back corectly so I ran it through a video converter saved it as a new file, this new file plays back just fine. When loading up the project I replaced the corrupt and AVI file with the new file. the software some how remembered all of my cuts on the time line. the vid took an unusual 10 hours to render and now plays back properly on the time line but after exporting it as both an AVI and MPG the exported files appear out of sink, out of sequence and jumps to footage that isn't even included on the time line.
    whoever can get their heads around this one is a fricking legend.
    Please help.

    Please tell us about your source footage, that AVI. This ARTICLE will give you some background on "wrappers," like AVI.
    What you describe sounds like the issues that one often faces, when trying to edit certain forms of .MPEG source footage. Both the OOS and the jumping to frames, that should not exist, are both manifestations of .MPEG's on the Timeline (not MPEG's with Export).
    Good luck,
    Hunt

  • Problem with sequences after import

    We recently imported some table data from QA to DEV and now the DEV database has issues with sequences errors. How can I resolve the problem with sequences since we have constraint violation errors as a result of the table sequences being out of sync after the import of several schema tables.

    We run a script like the following to get the sequences as close as possible after importing from PROD to DEV:
    set serveroutput on;
    DECLARE
         CURSOR CUR IS
              SELECT      otherdb_seq.sequence_owner AS owner,
                        otherdb_seq.sequence_name AS seq_nm,
                        TO_CHAR(otherdb_seq.last_number) AS start_nr
              FROM           dba_sequences currdb_seq,
                        dba_sequences@prod otherdb_seq
         WHERE      currdb_seq.sequence_owner IN ('~schemaname~') AND
                        currdb_seq.sequence_owner = otherdb_seq.sequence_owner AND
                   currdb_seq.SEQUENCE_NAME = otherdb_seq.sequence_name
              ORDER BY      1, 2;
         sql_string VARCHAR2(500);
    BEGIN
         FOR REC IN CUR
         LOOP
         sql_string := 'DROP SEQUENCE '||REC.owner||'.'||REC.seq_nm;
              DBMS_OUTPUT.PUT_LINE(sql_string||';');
              EXECUTE IMMEDIATE sql_string;
              sql_string := 'CREATE SEQUENCE '||REC.owner||'.'||REC.seq_nm;
              sql_string := sql_string ||' START WITH '||REC.start_nr;
              sql_string := sql_string ||' MAXVALUE 999999999999999999999999999';
              sql_string := sql_string ||' MINVALUE '||REC.start_nr;
              sql_string := sql_string ||' NOCYCLE NOCACHE ORDER';
              DBMS_OUTPUT.PUT_LINE(sql_string||';');
              EXECUTE IMMEDIATE sql_string;
              sql_string := 'DROP PUBLIC SYNONYM '||REC.seq_nm;
              DBMS_OUTPUT.PUT_LINE(sql_string||';');
              EXECUTE IMMEDIATE sql_string;
              sql_string := 'CREATE PUBLIC SYNONYM '||REC.seq_nm||' FOR '||REC.owner||'.'||REC.seq_nm;
              DBMS_OUTPUT.PUT_LINE(sql_string||';');
              EXECUTE IMMEDIATE sql_string;
              sql_string := 'GRANT SELECT ON '||REC.owner||'.'||REC.seq_nm||' TO PUBLIC';
              DBMS_OUTPUT.PUT_LINE(sql_string||';');
              EXECUTE IMMEDIATE sql_string;
         END LOOP;
    END;

  • In fcpX....how can I put an IN and OUT points in my sequence and after export a movie???

    In fcpX....how can I put an IN and OUT points in my sequence and after export a movie???

    You can't. You can't export part of a sequence. Duplicate it and remove the bits you don't want to export from the duplicate.

Maybe you are looking for

  • Db Adapter Logical Delete not working

    Hi, I have an ESB that contains a dbadapter that performs a logical delete once the esb has finished processing. The problem we are seeing is that this logical delete is not always happening. We update a field in the source table from 0 to 1 on succe

  • All iOS devices disconnecting randomly from D-Link router

    Hi, All my Apple devices disconnect every 10 to 15 minutes from my D-Link DIR-615 router. My Apple TV, 2 iPhones and my iPad always lose the connection. Can't stream anything on my Apple TV, I have to reset the router every 10 minutes. This happens o

  • My installation experience of SQL Developer Data Modeler

    Installed SDDM successfully at work (Windows 7 Enterprise 64-bit 4GB) and at home (Windows 7 Home Premium 64-bit 4GB) after many frustrating hours. Finally found the simple solution: 1. Download JDK 6u33 - Java SE Development Kit 6 Update 33 ( link b

  • ITAB_DUPLICATE_KEY

    Hi , We have received around 1000 dumps, most of them "ITAB_DUPLICATE_KEY" (PROGRAM : /PSYNG/SAPLSW_UTLS ) and "ASSERTION FAILED" (PROGRAM :   /SIE/SRM_AVOID_PARALLEL_RUN). Please find the logs. Category               ABAP Programming Error Runtime E

  • HT4623 Iphone Beeping when connected to itunes.

    My iphone 5s screen went dark today.  I have tired to fix it by connecting to itunes.  It now does a continual beeping when connected.  Any idea how I restart the phone without access due to dark screen?