name of the sequence must be created dynamically...

I have an application. .. usiing apex 4 db 11g...
Now I need to make a sequence in a similar way
Select ename in mname of the test;

Select test | double mname.nextval;

How can I do this... Can I use a sequence in this manner. . The sequence name is test + DATA IN the column has in a table...

pauljohny wrote:
I have an application. .. usiing apex 4 db 11g...
Now I need to make a sequence in a similar way
Select ename in mname of the test;

Select test | double mname.nextval;

How can I do this... Can I use a sequence in this manner. . The sequence name is test + DATA IN the column has in a table...

I don't know what you're asking. I hope that I answer the right question...

A technique I've seen used is generated dynamically name sequence according to a model expected, something like (not tested)

  select table_name into  v_table_name from whatever where condition = 'whatever';
  v_text := 'select '||v_table_name||'_seq.nextval from dual';
  execute immediate v_text into v_key;

I hope this helps.

Tags: Database

Similar Questions

  • Creative Cloud Lightroom import records show that year and not the name of the file that I created

    When I import files from an SD card to Lightroom, I import to an external drive as my file.  Indicates the name of the folder to the year (2015) and not the name of the file that I created (Fort Worth, 12152015).  This has happened with every import that I've done so far.  How can I fix it?

    The copy option is used to copy the files from your camera card. The Add option is used when the files are already on your hard drive. They must be copied, just added to the Lightroom Catalog. You can simply add the files that are located on a map of the camera. They must be copied to the hard drive first.

  • Printing of the .pdf of the 2013 project file will stop when the name of the file must be written. Project 2013 crashes. Anyone know what the problem is between 2013 project and Adobe Acrobat 9?

    Printing of the .pdf of the 2013 project file will stop when the name of the file must be written. Project 2013 crashes. Anyone know what the problem is between 2013 project and Adobe Acrobat 9?

    The family of products Acrobat 9.x passed in mid-2013 "end of Support".
    Using Acrobat 9 of MS Project via PDFMaker stops with Office 2007.
    To 2013 Office support, you must use Acrobat XI (11.0.1) or newer.

    A good reference:
    https://helpx.Adobe.com/Acrobat/KB/compatible-Web-browsers-PDFMaker-applications.html

    Acrobat Pro and Standard DC are what are currently available for purchase.

    Be well...

  • Combination of name and the sequence

    Hi all

    I have a table that has the following columns:

    Title, Class_name, sub_class_name, combination. (Of course, I have several tables maintenance, but it is the large table). the lov class_name parameter, sub_class_name is lov class_name cascading. in the field of the combination, I need class_name abbreviation-sub_class_name short-sequence number. This sequence number for each combination must start at 1.

    Now I lov and sub name class class name lov and when the user selects these two columns the combination appears with any number (I have a table of maintenance for this).

    For example = temporary payroll, class_name = Record staff (short PR), sub_class_name = mass pay (PAY abbreviation), the combination should show PR-COMPENSATION-1. Once again if a different title with the same class name and we subclass the combination should show PR-COMPENSATION-2. but IF the name of class and sub-class is different once again the combination should start from 1. I could create the combination but these number are not getting the correct number. Could you please help me on this.

    Thank you

    Stéphane

    Hello Pascal.

    A simple way to calculate the sequence number for a combination of the two fields is to do something like this:

    select nvl(max(sequence_num), 0) + 1
      from my_table
     where class_name = :P1_CLASS_NAME and
           sub_class_name = :P1_SUB_CLASS_NAME
    

    If one or more lines with the selected class name subclass name combination already exist in the table, max returns the sequence more high number with this combination, and then we add 1. If no line with this combination doesn't exist, max returns the null value which is then replaced by the nvl 0 and then we add 1.

    But I must point out two things:

    (1) your table design has a few redundancies in it that can cause you to hurt later. Your field of combination consists of the values of two other fields. In addition to being low standards, what happens to your field of combination if the user changes the fields class_name or sub_class_name? Minimally, you will need to update the characters in the field of combination to remain consistent, but you should also consider how the new combination would affect the sequence number. That gets into some difficult design problems that is why it always drives crazy me when users want to ID fields that contain information of business integrated, but anyway... to address the issue of standardization at least, I would like to suggest a class_name field, a field of sub_class_name and a field of sequence_num and then put the fields when you need to display.

    (2) If this form can be used by multiple users at the same time, you want to calculate the next sequence number when the line is saved - not when the two LOV is chosen. Raison d'etre, what happens if two users select the same combination at roughly the same time? If you calculate during the recording, then the two users cannot get the same next number in sequence. If you calculate as soon as they select the two LOV, there is a chance, they will receive the same next number in sequence. The way I'm usually something as it is to calculate the number on record and then display it in the message of success of the process - something like "PR-COMPENSATION-2 Record saved successfully."

    Hope this helps,
    John

    If you find this information useful, please indicate the 'useful' or 'correct' post so that others benefit. *

  • How to handle the onTriggered many ActionItem created dynamically

    Hi, I created the ActionItem dynamically using (loop)

    because data is from webservice

    How to handle the onTrigerred?

    If my code is like this:

    for (int i = 0; i)< alist.count();="">

    {

    My page page * = iRoot-->findChild ("SpecificObject");
    ActionItem * action = ActionItem::create () .title (aList [i] .name);

    bool res = QObject::connect (action, SIGNAL (triggered ()), this, SLOT (handleAction (())); what I'm confused because I don't know what action is triggered
    Q_ASSERT (res);
    Q_UNUSED (res);

    my page-> addAction (action, ActionBarPlacement:efault);

    }

    MyClass::handleAction() Sub

    {

    aFunction(); This parameter of function required of aList, said user.user aList [i]

    }

    Do I need to create handleAction() as well as added actionItem SLOT

    But I don't know how much action added because it is dynamic server

    Thank you

    There are a few options:

    Create a single location and connect all the signals. You can then call sender() into the slot to retrieve the object that sent the signal and go from there. You can also use a QSignalMap that maps each signal to a value and send this value to a single location. You can also use QSignalMap::sender() to get the sender object.

    I used the QSignalMap to do something similar for handling created dynamically successfully drop-down lists.

  • In passing the id of vs option name option value. Name of the option must display in the drop-down menu.

    The complete flex source is transferred to a file called source.txt. As forward using Flex and and a. CFC as primary server. Using

    the remote object to call the cfc and fill the drop-down list boxes. Which works very well. When the user presses the submit button after selecting

    combo box values want to send the id of the option which should be the "ticket_source_id" column in the sql statement for the "sourceInput" drop-down list box

    to send the id to the cfc. Now when the user selects "Phone" for example the source string 'phone' is sent. To get the

    ID, value that would be '2' to be sent instead, when this service is called "sourceDataService.goCreateTicket". Any help would be great.

    Thank you.

    [Bindable]
    private var recievedSourceData:ArrayCollection = new ArrayCollection(); / / Keep this vacuum

    private void getSource(returnedEvent:ResultEvent):void

    {
    recievedSourceData = returnedEvent.result as ArrayCollection collection;
    }

    private function sendForm (): void

    {

    sourceDataService.goCreateTicket (sourceInput.selectedItem.TICKET_SOURCE_ID);
    }

    ...

    It looks right! The result of your returnedEvent property must be an arrayCollection of objects (any point) collection. Each object has a property TICKET_SOURCE_ID and TICKET_SOURCE_NAME. If you do not change the names of these properties, then your labelField of the ComboBox must be on TICKET_SOURCE_NAME, so that it matches the property name!

    Dany

  • Using the label for datagrid created dynamically function

    I am creating a data grid dynamically based on the data returned by a script from the server call.

    I know that some of my data will be nested so I need to use a label function to check that these data are displayed in the datagrid control

    All of the examples of the use of a label function that I can find seem to have hard coded as in the following example columns

    < mx:columns >
    < mx:DataGridColumn headerText = "Name" dataField = "NomMenu" / >
    < mx:DataGridColumn headerText = "Vegetarian" labelFunction = "displayVegetarian" / >
    < mx:DataGridColumn headerText = "Peanuts" labelFunction = "displayPeanuts" / >
    < mx:DataGridColumn headerText = "Quantity" labelFunction = "displayQuantity" / >
    < mx:DataGridColumn headerText = 'Price' labelFunction = "displayPrice" / >
    < mx:DataGridColumn headerText = "Total industry" labelFunction = "displayLineTotal" / >
    < / mx:columns >

    However, I create my columns of the DataGrid dynamically if cannot use the < medium to achieve mx:DataGridColumn

    My code works as follows

    for (var i: uint = 0; i < xlColumns.length (); i ++) {}

    DGC = new DataGridColumn();
    dgc.dataField = "componentScores.ScoreValue" <-THIS NEEDS to USE A LABEL FUNCTION
    dgc.headerText = _qualificationSummaryScreenData.getComponentTitle (componentIndex);

    }

    I've highlighted above where I need to use a label function. I really hope that someone can help me here that I am currently taking one step forward and two steps backward with Flex right now and already several days behind on this project.

    Thank you very much

    Paul

    I do not exactly remember the syntax, but you can assign a function to the labalFunction property:
    dgc.labelFunction = myHandlerFunction; something like that

    Have you tried that yet?

    Tracy

  • How can I list by program stage names in the sequence file

    I need the list of all the steps in the movie TS file. For example, sequence.seq file cointains dwarf and it includes following steps:

    Step 1

    Step 2

    Step 3

    ...

    step100

    I can easily select all of these steps and then copy - paste them in the excel worksheet. However, I would like to do this programmatically because I very much .seq file containing many steps.

    Can you help me?

    Hi esanum,

    Have you seen this?

  • Dynamically read the table name in the query update

    Hi all

    I am trying to run the updated sql query where the name of the table should be read dynamically from another table below.

    Please let me what wrong with my request.

    setting a day (select CONCAT('T',schemaid) from outline, which the name = 'Analyzer') set c7 = 99;

    "outline" is a table that contains two columns name and schemaid.

    all the table created in our database with the prefix 't' T4345 for example.

    I did as suggested by you

    No, you didn't.  I did not any package creation code in my example, in order to better that you you point the finger.

    Your syntax is invalid for creating a package with the code like this, please read on creating packages and procedures within them if that's what you want to do.

    In addition, your package creation statement is to create a package specification, but you put in the code which must be in a package body, not a notebook loads.

    It should be something like (untested since I don't have your tables)...

    create or replace package my_packg as
    procedure dowhatever.
    end;
    /

    create or replace package body my_packg as
    dowhatever procedure is
    TBL varchar2 (30);
    Start
    Select 't' | SchemaId
    in tbl
    of outline
    where name = 'Analyzer ';
    run immediately 'Update'. "TBL |' set c7 = 99;
    end;
    end my_packg;
    /

    and then call this procedure by calling my_packg.dowhatever ();

  • name of the site 2 site tunnel (peer IP) must match on both sides?

    Hello.

    I'm trying to set up some private networks virtual site 2 site between 3 offices using 3 cisco ASA 5505.

    In the manul to these ASAs, it is said that when you set up the connection (I use ASDM and the wizard of easyVPN) it is said that when you use a PSK for authentication between the two sites, the name of tunnel must be the IP address of the peer. Is it OK so far?

    Because I always thought that the names of the tunnel must be identical on each side. So it means that the site one tunnel name will be site of 2 IP address while on site 2, the tunnel will be the IP address of the site from 1. Is this correct? As I said I always thought that the names of tunnel should match the other.

    Also, can someone tell me if this configuration works.

    I have 3 sites that I want to put in a mesh VPN site2site scenario.

    So basically, I have 3 routers. And on each router, there will be 2 site2site tunnels configured (via easyVPN ASDM) for the other 2. This sound is feasible? And if so, the names of tunnel for each connection on each router will be the IP address peer?

    Appreciate any idea.

    Hi Matthew

    Tunnel name musnt/beveled or even on the two sites. Only IP address peer and tunnel-group must be same to site A.

    Lets say that the site will allow you to create a VPN as follows

    A B - C

    An interface IP = x.x.x.x site

    Interface of the site B IP = y.y.y.y

    Interface of the site C IP = z.z.z.z

    Thus, in the ASA in site a.

    tunnel-group y.y.y.y type ipsec-l2l

    xmap 10 crypto map peer set y.y.y.y

    ASA in site b.

    tunnel-group x.x.x.x type ipsec-l2l

    xmap 10 crypto map peer set x.x.x.x

    tunnel-group z.z.z.z type ipsec-l2l

    card crypto xmap 20 peers set z.z.z.z

    ASA in site C

    tunnel-group y.y.y.y type ipsec-l2l

    xmap 10 crypto map peer set y.y.y.y

    Concerning

  • How to change the name of the map dynamically?

    I use an excel template and my requirement is to change the name of the spreadsheet (NOT the file name) of the output to excel when blow up.

    Is this possible and if so, how? The user wants to get the group number and the name of the report.

    For example Group 1 a and the name of the report, audit report, the name of the spreadsheet must be "1 a - Audit report.

    I understand that with the constraints of data in the XDO_METADATA worksheet.

    We can add two functions XDO_SHEET_? and XDO_SHEET_NAME_? By aggregating my data correctly, I was able to produce several sheets with dynamic for each worksheet name.

    More information search for these two functions and you will find your answer.

  • the name of the file created in variable

    using oracle 11.2.0.3.0

    I have a procedure that creates a CSV on my server. It works perfectly. My question is how to get the file name once the file has been created, and put it into a variable in the same procedure.

    create or replace

    PROCEDURE 'CSV_GEN' AS

    v_wK varchar2 (30);

    BEGIN

    RUN IMMEDIATELY "ALTER SESSION SET NLS_DATE_FORMAT =" YYYY-MM-DD HH: MI: SS AM "';"

    SELECT

    Replace(PERIOD_NAME, ' ', '_') IN v_wK

    OF TIME_WEEK_V

    WHERE SYSDATE-7 BETWEEN PERIOD_START AND PERIOD_END and rownum = 1;

    GEN_CSV_FILE

    (

    "SELECT * FROM WEEKLY_V',

    "my_FILES."

    "MY_DOCS" |  '_' || v_wK | '. CSV'

    );

    -so now I have created the file, and it has a name. How can I get this name in a variable, here.

    EXCEPTION

    WHILE OTHERS THEN

    LOG_ERROR();

    COMMIT;

    LIFT;

    END;

    Thanks for any help.

    Hello

    Is that what you want?

    PROCEDURE 'CSV_GEN' AS
    v_wK varchar2 (30);
        name varchar2 (50);                          -* ADDED *.
    BEGIN
    RUN IMMEDIATELY "ALTER SESSION SET NLS_DATE_FORMAT =" YYYY-MM-DD HH: MI: SS AM "';"

    SELECT
    Replace(PERIOD_NAME, ' ', '_') IN v_wK
    OF TIME_WEEK_V
    WHERE SYSDATE-7 BETWEEN PERIOD_START AND PERIOD_END and rownum = 1;
     
      filename: = "MY_DOCS" |  '_' || v_wK | '. CSV';    -* ADDED *.

    GEN_CSV_FILE
    (
    "SELECT * FROM WEEKLY_V',
    "my_FILES."
    the file name-* CHANGED *.
     );

    EXCEPTION
    WHILE OTHERS THEN
    LOG_ERROR();
    COMMIT;
    LIFT;
    END;

  • Create a Trigger - what is the name of the new table?

    Hello

    I want to implement a new trigger (CREATE TABLE) on my database only for specific tables in a table space.
    As far as I know, I have to set the trigger for the entire database and filter tables in the trigger to
    that I want to do any action.

    It's my first try:

    CREATE OR REPLACE TRIGGER compress_new_tables
    AFTER CREATE ON THE DATABASE
    BEGIN
    dbms_output.put_line ("' new Table name");
    END;
    /

    Unfortunately I do not know how to determine the user as well as the name of the table that was created.
    Could someone help please?

    Py wrote:
    Hello

    I want to implement a new trigger (CREATE TABLE) on my database only for specific tables in a table space.
    As far as I know, I have to set the trigger for the entire database and filter tables in the trigger to
    that I want to do any action.

    It's my first try:

    CREATE OR REPLACE TRIGGER compress_new_tables
    AFTER CREATE ON THE DATABASE
    BEGIN
    dbms_output.put_line ("' new Table name");
    END;
    /

    Unfortunately I do not know how to determine the user as well as the name of the table that was created.
    Could someone help please?

    http://www.morganslibrary.org/reference/ddl_trigger.html

  • Need name of the API to create the hierarchy of the Organization for Oracle HRMS

    Hi all



    (1) name of the API need to create the hierarchy of the Organization for Oracle HRMS

    (2) in the form of the Organization, we have added the Classification, 'HR'.
    When we press 'Costing Information' is displayed.
    We need to download this Information of costs in the body through the API.
    Which API should we used?

    This is urgent.
    Any help in that regard will be highly appreciated

    Thank you

    Hi, Ahmed.

    You can find all the APIs here-
    http://irep11i10.Oracle.com

    Hierarchy of org-
    http://irep11i10.oracle.com/OA_HTML/OA.jsp?page=/oracle/apps/fnd/rep/webui/InterfaceListPG&BusinessEntity=PER_ORGANIZATION_HIERARCHY&Title=Organization+Hierarchy&retainAM=Y&_ti=2010961940&oapc=7&selection=11_1_62_&oas=s6j2chTrx3F6QeAofgAR-Q..

    To check information of costs - create the organization information (information of costs goes into HR_Organization_Information table, just check for the correct contexts)
    http://irep11i10.Oracle.com/OA_HTML/OA.jsp?page=/Oracle/Apps/FND/Rep/WebUI/PLSQLInterfaceDetailsPG&CategoryValue=F&_tI=2010961940&retainAM=Y&addBreadCrumb=Y&OAPC=16&OAS=rEOv_-poEcBvZjTjyrCnXw...

    http://irep11i10.oracle.com/OA_HTML/OA.jsp?page=/oracle/apps/fnd/rep/webui/InterfaceListPG&BusinessEntity=HR_ORGANIZATION&Title=HRMS+Organization&retainAM=Y&_ti=2010961940&selection=11_1_49_&oapc=28&oas=Ns8RX2ZaTcv6y_BMwx0d7Q..

    Hope that helps.

    If the links above do not work. Try to copy - paste the full URL in a new window. It should work.

    See you soon,.
    Vigneswar ben ahmed

    PS: You can also try loading. The free version should suffice. And it is a wonderful tool.
    http://www.dataLoad.com/downloads/index.html

  • Publish in the sequence of creation

    Hi all

    I use
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I have the diagram with the following roles
    ALTER ANY OUTLINE
    CREATE ANY OUTLINE
    CREATE ANY SYNONYM
    CREATE DATABASE LINK
    CREATE MATERIALIZED VIEW
    CREATE PUBLIC DATABASE LINK
    CREATE VIEW
    DROP ANY OUTLINE
    DROP PUBLIC DATABASE LINK
    SELECT ANY TABLE
    UNLIMITED TABLESPACE
    CONNECT
    DBA
    EXP_FULL_DATABASE
    IMP_FULL_DATABASE
    OEM_MONITOR
    RESOURCE
    I can create a sequence by SQLPLUS and toad.
    SQL> CREATE SEQUENCE ROLE_ACTIVITY_SEQ START WITH 225006249 INCREMENT BY 1 MAXVALUE 9999999999999999999 MINVALUE 225006249 NOCYCLE CACHE 100 ORDER;
    
    Sequence created.
    
    SQL>
    When I try to create the sequence in a dynamic way through get error in PL/SQL procedure
    SQL> execute PROC_CLONE_BU;
    BEGIN PROC_CLONE_BU; END;
    
    *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SUPERNOVA.PROC_CLONE_BU", line 19
    ORA-06512: at line 1
    
    
    SQL>
    Even though I have the DBA role for the schema. I do not know what oracle of privileges always the exception...

    Pls guide me to solve...

    Thanks and greetings
    Saami

    Procedures PL/SQL etc (except anonymous PL/SQL) does not take into account the roles.
    You must grant permission to create sequences explicitly to the user who will perform the procedure.

    You can also get the procedure to use a particular role, but you end up switching dynamically from the roles in your code and things can get messy. If a user is supposed to be able to do something, it's much cleaner (IMHO) to give explicit permission to the user that something.

    You should also question yourself as to why you are trying to create a sequence dynamically to the execution of your code? What is the purpose of the present, and why the sequence cannot be created as part of database design?

Maybe you are looking for