Create the Select sequence with the request number

Hi all

I would like to create a sequence number in oracle, but instead of coding hard 'start with' I want to choose the max value of the primary key of a table and add 1 and use it instead:

So what I want is:
CREATE SEQUENCE crg_mrec_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH select max(primarykey)+1 from table1
INCREMENT BY 1
CACHE 20;
I guess I have to spend this max value as a variable in the create sequence number, but I'm not sure of the syntax to use.

Thank you
Ed

Hello

The START WITH value must be a literal NUMBER. You need dynamic SQL statements to do what you asked.
EXECUTE IMMEDIATE, as mentioned above, is a way to make the dynamic SQL statements.
In SQL * Plus, the substitution variables are another.

COLUMN     first_num_col     NEW_VALUE first_num

SELECT  MAX (primarykey) + 1        AS first_num_col
FROM      table1;

CREATE SEQUENCE crg_mrec_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH  &first_num
INCREMENT BY 1
CACHE 20;

Tags: Database

Similar Questions

  • Error creating a salary. ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package

    Hi all

    We try to add new proposal for a salary of some employees from form August 1, 2015 (the Date of the beginning of employee)

    There is no existing salary proposal doesn't exist for these employees.

    We get below error.


    ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package


    Help, please.

    Thank you

    Tarun

    Hi John,.

    If it helps, take a look at the following note:

    ORA-01422 exact Fetch returns more than number of lines requested in Hr_maintain_proposal_swi (Doc ID 1673527.1)

    Kind regards

    Rajen

  • Create the request for approval to remove the user operation with IOM api-11 g Release2

    Hello

    How do I create an approval request for an API using operation user remove? Can someone guide me? Any help is greatly appreciated...


    ARO
    Aliye

    You must use the new API set to create the request. OIM 11 g R2 supports model not application so your code will be changed.

    Examples: http://docs.oracle.com/cd/E27559_01/doc.1112/e28183/oim_up.htm#BABGBEHG

  • How to create the point number fixed scripted LabVIEW VI

    Hello

    How can I create a LabVIEW VI scripted fixed-point number? And set the word length and the length of whole word?


  • Unable to create the request of several users in oim 11 g 2

    Hello

    I am trying to assign a resource to multiple users using IOM identity console as a system administrator.

    But when I assign the resource to multiple users its takes the same value for both users.

    Please let me know how to add the different value for different users.

    Thank you

    Here are the rules of its operation.  An application has 1 application form by resource for all users of the application.  These fields must be marked as available in bulk as well to consider if you have more than 1 user on demand.  If you need to provide different values according to the user, your best option is to pre-fill the cards on the form of courses and use logic to fill in the fields.  You will not be able to manually provide different values during the request.

    -Kevin

  • Create the request page to work, help.

    I have a document of employment application that people are able to type in the right places.  I was wondering how I could put this in one of my Web pages so that people can still type in the right places and when he clicks on submit their full application is sent to me.  If there is a way to do it or if there is no alternative to a job application page, please reply to this email.  Any help is greatly appreiated.

    You have to basically re-create the form (I assume it's in Word or PDF or something similar?) in html using the

    tag and severallabels for the boxes and text fields.

    To create the form will be under Insert > form DW

    You first go to Insert > form > form and place the realtagset that will contain everything. Then you use a combination of boxes of text, parts of text, checkboxes, radio buttons and more Insert > instead of the form to get user input.

    It is relatively simple, however get all aligned on the way which you love takes a little more effort. If search you online for "Creating forms in Dreamweaver" there are tons of places that give you the basics.

    Once you have the page created, that's when you get the server-side script, and then attach your form. Depends on what you choose for a processing script that your server supports. Most will support PHP, which is what they use in the link I gave you.

  • First Pro CC does not create a new sequence with a new project

    I'm sure I must be missing something, but when I create a new project in first Pro CC, it does not automatically create a new sequence.

    In CS6, create a new project would cause a list of sequence presets, and then create a sequence is empty for you.

    In CC, once you have created a project, you end up looking at an empty timeline.  You then go to the file, new, sequence and it do.

    Looks like a strange step to include, no?

    Is there a setting that I have not found so made CC to create new projects with a sequence like CS6?

    Yes, as Jim mentioned, there are other ways to create a sequence.  For example, simply import your video footage and then with a clip selected, choose file > New > sequence of the Clip.  Or in the project Panel, drag an item to a new item icon.  Much easier create the sequence of way, rather than by reading all the parameters in the dialog box new sequence and try to understand which attributes correspond to the media they work with.

  • C# create file of sequence with markets

    I am using the c# API in order to create a sequence file that can be loaded in TestStand. When I try to create a step, I gives me the error:

    Additional information: step enter 'Action' not found in the type list

    I am using the following:

    class Teststand
    {
    Engine engine;
    File SequenceFile;

    public Teststand()
    {
    engine = new Engine();
    }

    Public Sub new_sequence()
    {
    engine = file. NewSequenceFile();

    Sequence seq = engine. NewSequence();
    Name = "Example".

    Step motor =. NewStep ('no adapter', 'Action');
    step. Name = "step Test".

    save_sequence_file (@ "C:\Users\me\Desktop\output.seq");
    }

    public void save_sequence_file (string file_path)
    {
    file. Save (\\server\share\file_path);
    }
    }
    }

    I know that I'm not add step to the sequence file immediately, but certainly would not be the cause of the problem? Why can't he find the step type? I tried several types and even tried

    StepTypes.StepType_Action

    Gives me just the same idea.

    I'm very confused about how to specify the type of property, can anyone help?

    Hi adam_.

    It is recommended to add the new step in the TypeUsageList of the sequence file is inserted it into:

    class Teststand
    {
    Engine engine;
    File SequenceFile;

    public Teststand()
    {
    engine = new Engine();
    engine. LoadTypePaletteFilesEx (TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
    }

    Public Sub new_sequence()
    {
    engine = file. NewSequenceFile();

    Sequence seq = engine. NewSequence();
    Name = "Example".
    file. InsertSequenceEx (file.) NumSequences, seq);

    Step motor =. NewStep ("no adapter", "Action");
    step. Name = "step Test".
    file. AsPropertyObjectFile(). TypeUsageList.AddUsedTypes (step. AsPropertyObject());
    seq. InsertStep (step 0, StepGroups.StepGroup_Main);

    save_sequence_file (Environment.GetFolderPath (Environment.SpecialFolder.Desktop) + @ "\output.seq");
    }

    public void save_sequence_file (string file_path)
    {
    file. Save (\\server\share\file_path);
    }
    }
    }

    Here are the things I added to your code:

    1. Engine.LoadTypePaletteFilesEx

    2. SequenceFile.InsertSequenceEx

    3. TypeUsageList.AddUsedTypes

    4. Sequence.InsertStep

    5. Environment.GetFolderPath (Environment.SpecialFolder)

    Kind regards

    The f

  • Problems with Facebook, request number of mobile phone and also cannot send anything to send anything to his teammates while playing games.

    Original title: frustrated!

    When you play on fb slotmania or bingoblitz I no longer can I send anything to teammates stating that there is a security risk. Also he always tells me to put in my cell phone no. or I'll lose fb. Help! THX

    Hello

    1. The question is limited to Facebook?
    2. Do you have similar problems with other sites?
    3. What web browser you use to access the Internet?

    Where the question is specific Facebook then you can contact Facebook support for more help.

    http://www.Facebook.com/help/

  • Create the user with privileges only data entry.

    Hello guys,.

    A very basic question. I created the request of APEX, well obviously the user with whom I created this application has developer access, now I want to create a user who is able to see the developed application, I tried to find the user options, but could not.  Someone can help me to find the option, I need to follow, so that the newly created user is only able to enter data into forms and run reports and should not be able to make changes in the application developed.

    Concerning

    Faisal Niazi says:

    A very basic question. I created the request of APEX, well obviously the user with whom I created this application has developer access, now I want to create a user who is able to see the developed application, I tried to find the user options, but could not.  Someone can help me to find the option, I need to follow, so that the newly created user is only able to enter data into forms and run reports and should not be able to make changes in the application developed.

    Create 'end users' by selecting No for the user is an administrator of the workspace and the user is a developer account privilege options create new user accounts. These users connect to the APEX Application Builder. It can be given direct access to a request by specifying the ID of the application or alias to the URL:

    apex.oracle.com/pls/apex/f?p=

    or

    apex.oracle.com/pls/apex/f?p=

    Using an alias for the application is recommended.

    To restrict user access to pages, components and specific applications, create authorisation schemes and the apply to the application level.

  • First Pro CC (2014) crashes if I try to find some images/scrub/create an empty sequence, please help

    Hello, this is my first time asking for help here, I have been going around forums and web in general for hours, and can't find a solution to this. I really hope someone can help me with this.

    Whenever I have try and open a project Pr CC 2014 on my Mac Pro I get the "sorry, a serious error has occurred which requires Adobe Premiere Pro to stop. We will try and save your current project. »

    People usually ask for as many details as possible, so this effect: This is a project that I started on my MacBook Pro retina so when opening on my desk he invites me to locate images. Once I find the first file, as soon as my mouse passes on the clip (to the point that rub should be evoked) I get the warning and it stops. I tried to open a new blank project, which doesn't close, until I go to import images and even once, it crashes only when the mouse is moving the clamp to rub. I tried to find the images in the finder to evade the media browser, and this allowed me to select the clip, but crashes once I tried to import it. I thought that maybe the film has been altered, so I tried other clips with the same result. Also, it crashes if I try just to create a new sequence, with images at all in the project.

    All my other Adobe apps (SOUL, Pl, Ae, Br, Ai, Ps, Lr, Id, Mu) are working properly. I've uninstalled and reinstalled Pr and SOUL twice now. I followed the advice of others and renamed/reset/deleted preferences, plugins in the library and the adobe folder in users/user_name/Documents. I have ensured that I have read/write access in all folders. I am running Yosemite on my desktop, but is so my laptop and Pr runs perfectly on that. I never had this problem with Pr CC before 2014, so I hope that this is not a hardware issue.

    I also tried turning off and on again!

    I reached the end of my tether and considers indeed defeated by this problem. I really hope someone out there can understand what is happening on Earth!

    Mac Pro (early 2009)

    2 x 2.26 GHz Quad - Core Intel Xeon

    11 GB 1066 MHz DDR3 ECC

    ATI Radeon HD 5770 1024 MB

    and

    MacBook Pro (15 inch, early 2013 retina)

    Intel Core i7 2.7 GHz

    16 GB 1600 MHz DDR3

    Intel HD Graphics 4000 1024 MB

    Hi Man0fst331,

    Try the following:

    Report if anything here has worked for you.

    Thank you

    Kevin

  • Dynamic, create the sequence then select nextval within a transaction

    The following procedure does not compile if the sequence SEQ_ADR does not exist before compilation. I had to manually create the sequence before you can compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    )
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;
    Published by: totalnewby on August 23, 2012 06:41

    The SELECTION against the sequence should be dynamic as well. Otherwise, the procedure has a dependency on a non-existent sequence.

  • I created a PDF form with several drop downs, all with the same drop-down values. When I select a value of 1 in the drop-down list fields, it breeds in all others - which I don't want. How can I fix?

    I created a PDF form with several drop downs, all with the same drop-down values. When I select a value of 1 in the drop-down list fields, it breeds in all others - which I don't want. Can I fix?

    I am fairly new to this, but I think it has to do with the way you have drop them downs named. Copy you a then keep stick in each area? If so, that's the problem. You must rename each with a different number: Dropdown1, Dropdown2, etc. I think this might solve the problem.

  • Purchase order number do not go with the request while showing on the form?

    Hi all

    I create a purchase order and save my work. I know, that this base table is po_headers_all
    When I po since the request form, shows. but with the next request, there is no record

    Select * from po_headers_all where po_header_id = 1704;

    Note: po is just save but not submit it for approval.

    Thank you
    Yoann

    Maybe you wondering about the wrong column?

    Try:

    Select * from po_headers_all where segment1 = "1704";

  • Zip code does not match with the Service request number

    Hello
    I can, check the State of repair of my Xbox to the t.
    It keeps giving the same error (ZIP Code does not match with the Service request number).

    I tried to register the product.
    but it seems impossible, if it has a status of repair open.

    a catch 22.

    Hello

    I suggest you go through the following link.

    http://www.Xbox.com/en-us/

Maybe you are looking for

  • Tab Utilities is not compatible with FF17. Thousands of users are now without an essential add-on. Is there a solution?

    This module is an important for me and thousands of other institutions. Unfortunately, this very useful add-on and the feature has now gone to my FF from 17... Many people are without downgrading or refusing to upgrade only because it will break this

  • Satellite T110-121 - broken the hinge/bracket

    Anyone know the part number of a set of display/hinge for the T110-121 media? Mine broke last week and I can't seem to buy a replacement or a suitable alternative.Thanks in advance.

  • HP LaserJet Pro 100 M175a MFP

    Hi, I'm looking for the technique of the specification of MFP175a or MFP176a, the size of the copy and scanning is capable for A4 (8.5 x 11) and legal-size (8.5 x 14)? That is, if the machine can copy/scanning through the open bucket (put the origina

  • Time increment

    Hi all I'm new to Dasylab and I need a help to the sampling frequency setting or the block in the middle of the experience. I want to recover my data for each of: for the first 30 minutes 1 second 1 minute for 5 hours after that 1 hours continuously

  • FFT of an image

    Hello I have an image of size M X N (pixel). Fisrt first saw the image of the location of path. Then I used Unflatten Pixmap VI to convert the image to a table. Now I need to find the D 2 FFT. I do the FFT by fisting the transformations of lines in p