How to block a select statement for a table of the specified until validation line

Hello

How to block a SELECT statement for a specified row in a table until willingness to engage occure?

My procedure is part of a Stock request and if a user (X) get stock 1 piece, another user must wait for the user (Y) complete his reportoire.

So, let say my stock have 10 pencils.

When the X user starts the Stock_PLS procedure, in table Stock, line (e.g. R1) that user X should work with it, must be lock up to what the commit / rollback will appear.

procedure Stock_PLS...

Start
..
pencils: pencils-1 =;
..
End

Observation-> pencils: = 9;


This means that is a user there, run SELECT * stock of the table where rows_id = R1, SELECTION should wait the Stock_PLS started by user X will be completed (with commit or rollback) and his SELECT should return the value 9.

What I need, is that Oracle has something like LINE EXCLUSIVE TABLE LOCK, but in my situation the SELECT statement should be denied on the specified lines, until the end of the procedure.

Kind regards
Michael

Hello
You can achieve this using the update with the Select clause.
You can write your select statement like this
SELECT * from stock of the table where rows_id = R1 for update;

Tags: Database

Similar Questions

  • How to set address static IP for cisco APS to the controller via command line

    Hello

    in our project it 208 APS registered in a WISN-1 controller

    How do I assign a static ip address to this Aps via command line in a controller 4404

    Thanks to the Internet, it takes more time to assign the static ip address

    You don't mention what version of the code, you are on but on 7.0:

    ap static IP config activate

    You can also add

    ap static IP config add domain

    ap static IP config add nameserver

  • How can I print a statement for my adobe account?

    How can I print a statement for my adobe account?

    I found the answer on the help. 'Manage accounts' and print the pdf.

  • SQL SELECT statement as a parameter in the procedure of string

    Hi all

    I'm new to PL/SQL and I must get a procedure as parameter select SQL select statement as a VARCHAR and the production output the result of the statement with a few changes. Can someone help me solve this problem?

    A possibility I thought at was to use a REF CURSOR. The following example works but binds me to a specific table (in the example of the "customers" table). However, I need the ability to specify arbitrary tables in the select statement parameter.
    SET SERVEROUTPUT ON
    DECLARE
      TYPE my_cur IS REF CURSOR;
      query_cursor my_cur;
    BEGIN
      OPEN query_cursor FOR 'SELECT * FROM customers';
      DECLARE
        record_type customers%ROWTYPE;
      BEGIN
         LOOP
            FETCH query_cursor INTO record_type;
            EXIT WHEN query_cursor%NOTFOUND;
            DBMS_OUTPUT.PUT_LINE('some output ... ');
         END LOOP;
      END;
      CLOSE query_cursor;
    END;
    /
    My idea was to modify this example to work in the following code, but it does not work (I get a compile error):
    SET SERVEROUTPUT ON
    DECLARE
      TYPE my_cur IS REF CURSOR;
      query_cursor my_cur;
    BEGIN
    
      OPEN query_cursor FOR 'SELECT * FROM customers';
    
      DECLARE
        record_type query_cursor%ROWTYPE;
      BEGIN
         LOOP
            FETCH query_cursor INTO record_type;
            EXIT WHEN query_cursor%NOTFOUND;
            DBMS_OUTPUT.PUT_LINE('some output ... ');
         END LOOP;
      END;
      
      CLOSE query_cursor;
    
    END;
    /
    Does anyone has an idea how can I solve my problem?

    Thank you very much!
    (I'm using Oracle 11 g)

    This can help.
    Re: Dynamic Extraction on dynamic Sql

  • How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    If you want the formula is the same (B2 - C2) in the cell of each column you must change it as ($B$ - 2$ C$ 2). Then copy it, select the whole column and paste.

  • How to return us an invitation for a member of the team?

    We had to build a new computer for a member of the team.

    How to return us an invitation for a member of the team?

    Hi Jim,.

    If the team member already has an active license of the team, do not re - invite.

    Please refer to the help documents below to download the application Adobe CC:

    Creative cloud to desktop

    Download, install, update or uninstall applications

    In the event that the Member did not have an active license, please see the help below document:

    Manage your creative cloud to the membership of the teams

    Kind regards

    Sheena

  • Please how can I use a value in a table of the adf in an actionListener to a button I created in a popup and thanks

    Please how can I use a value in a table of the adf in an actionListener to a button I created in a popup and thanks

    What is your version of JDev?

    Actually your question is not clear to me, but as I understand, it is you the table in the page and you have popup inside this popup you have the button you need when you click on the button to read the value of the selected table row. In the listener action button, so if you can get the current row of the table and after that you can get any attribute of the line as:

    DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("TableIteratorName"); // from pageDef.
    Row r = iter.getCurrentRow();
    Object value1 = r.getAttribute("attribute1");
    Object value2 = r.getAttribute("attribute2");
    
  • How to rotate a Select element for a GUI design

    Hello, I work on this project of GUI non-profit and need to make a prototype of high fidelity with the graphics, I created. Most of my experience was in web design and I usually used Axure RP pro for the realization of prototypes that works very well for the web but this GUI is clearly for a video game and so some of the menus work way are a little more sophisticated and "flashy" so I decided to use well, flash. Now I have very little experience with the side of flash action script and I just need to get out a prototype as soon as possible, I don't have to do anything work perfectly, just enough to get the message

    My question is on this Panel to select turning point. How would I go about using these orange arrows brilliant to rotate all the elements around the button "equip" when you press on? and how would program it each item on the scale when it snaps into the selected element? And of course the stats change when the element snaps as well.

    I am very grateful for all the help that can be provided on this.

    BLITZ-BRIGADE-SHOP-rotation-crop.png

    :

    kglad wrote:

    buttons have a number of limitations that movieclips are not.  the only advantage of buttons, is that they require no coding for high, low States while movieclips are.

    in any case, if your up arrow is up_arrow, down arrow is down_arrow, and guns are gun_0, gun_1 etc.:

    assign x 0, y0 etc. to match the 5 positions of your weapons.

    var int index = 0;

    var positionA:Array = [[x 0, y0], [x 1, y1],..., [x 4, y4]];

    Click on the listeners who call rotateF

    Up_Arrow.addEventListener (MouseEvent.Click, rotateF);

    Down_Arrow.addEventListener (MouseEvent.Click, rotateF);

    function called when you click on arrows

    function rotateF(e:MouseEvent):void {}

    loop through each firearm

    for (var i: int = 0; i<>

    loop on gun positions

    for (var j: int = 0; j<>

    find the position of each weapon

    If (this ["gun_" + i] there is positionA [j] [1] ;){

    Once the position of each weapon is found, determine if the up or down button was clicked

    {if(e.currentTarget.Name=="Up_Arrow")}

    clicked the top arrow key or move to the next position of gun

    var nextJ:int = (j + 1) %positionA.length;

    } else {}

    below then click go back a gun position

    nextJ = (j+positionA.length-1)%positionA.length;

    }

    assign the ith next or previous position pistol

    This ["gun_" + i] .x = positionA [nextJ] [0];

    This ["gun_" + i] there = positionA [nextJ] [1];

    put the scale on the gun expanded by resetting all.

    This ['gun_' I] .scaleX = this ["gun_" + i] .scaleY = 1;

    {if(j==2)}

    expand the "chosen" (IE, the middle position) gun

    This ['gun_' I] .scaleX = this ["gun_" + i] .scaleY = 2;

    }

    stop a loop in the posts.  the location of the ith mortars has already been found.

    break;

    }

    }

    }

    }

  • VMware VIEW how to block or unallow USB for some users

    Hi guys,.

    I have a question, I can block or unallow USB for some users? not all users just someone, I have a pool with 25 machines and need block USB for 4 users, do you have any idea how to do that?

    Thanks for your help

    GPO USB - http://www.petri.co.il/disable_usb_disks_with_gpo.htm

  • How to get a select statement to pass a variable as the OUT parameter in PROC

    I have the underside of the nested select statement that returns the name of the missing table (data_table_name).

    How to be an effective way to modify the select statement, so that the returned 'data_table_name' is passed as OUTPUT in a procedure parameter
    select 'Missing Table Name : ' || data_table_name
         from   ( select upper(data_table_name) data_table_name
                  from   TABLE1
                  where  data_table_name in ('ABC',EFG','XYZ')
                MINUS
              ( select upper(fus_data_table_name)
                from   TABLE2
                where  fus_data_table_name in ('EFG',')
              group by
                     upper(fus_data_table_name)
              union
              select upper(fus_data_table_name)
              from   TABLE2
              where  fus_data_table_name = 'LMN'
              group  by
                     upper(fus_data_table_name)
            ));
    Any help is greatly appreciated.

    S
    CREATE OR REPLACE PROCEDURE myproc (tname OUT NOCOPY VARCHAR2) AUTHID CURRENT_USER IS
    BEGIN
      SELECT something
      INTO tname
      FROM whatever;
    EXCEPTION
      WHEN OTHERS THEN
        tname := ;
    END myproc;
    /
    
  • How to get performance counter stats for virtual machine?

    Hi again,

    I managed to connect to the web service using VI SDK 2.5 and I can't what are virtual machines installed on the host system. I want to get the VMS performance counter values. How to get values of virtual machines performance counter?

    try {

    service = util.getConnection () .getService ();

    SIC is util.getConnection () .getServiceContent ();.

    perfMgr = sic.getPerfManager ();

    Utils VMUtils = new VMUtils (util);

    The list of virtual machines on a host

    ArrayList vmList = utils.getVMs (null,null,null,null,null, arg,new String [1] [2]);

    I havef(vmList! = null) {}

    System. .println ("Host a" + vmList.size () + "virtual machines");

    System. the.println ("name vm" + vmList.get (0) m:System.NET.SocketAddress.ToString () + "vm 2" + vmList.get (1) m:System.NET.SocketAddress.ToString ());

    }

    }

    catch (Exception ex) {

    ex.printStackTrace ();

    }

    Clues?

    ! http://communities.VMware.com/images/emoticons/sad.gif !

    Hello

    In order to obtain the performance counter for a managed entity, you must have following:

    1. get the managed object to the PerformanceManager object reference

    2 get the ProviderSummary object for this entity. It also helps determine if the current or summary statistics are supported.

    3. get performance metrics available for the entity. In a given time interval, the statistics will be available for these measures.

    4. the performance statistics for the entity desired metrics extracted from the step above queries

    5 examine the returned data object to get the statistics.

    Attached, is an example of Java, which takes the name of the virtual machine, run the steps above and print the available counters and their stats. You can take the help of this example and can improve to get statistics for all the virtual machines in your host application.

    Hope this information is useful.

    -Neha

  • How to convert this select statement in the update

    Hai All

    I have two tables namely Daily_attend, Train_mast

    The Daily_attend are made up of fields are Train_mast are made up of fields are

    Name varchar form no var

    Date of empcode Num V_DATE

    Intimate Date Train_name var

    Outtime date Late_hrs var

    Number IND_IN

    Number IDE_OUT

    Date of Attend_date


    I need to update the table Depend of IDE_IN in Daily_attend in late_hrs in the Train_mast table

    I got through in the select statement, it is my select statement

    Select to_number (TO_DATE (TO_CHAR(Intime,'DD-MON-YYYY') |)) » '||
    To_char (0815, '0000'), 'MON-DD-YYYY HH24') + late_hrs /(24*60)-respondent
    ) * 24 * 60 dail_Att, train_mast;

    How can I convert to update

    Any help is highly appricateable

    Thanks in advance

    Concerning

    Srikkanth.M

    Srikkanth,

    Try this code. And 1 thing, I don't see any WHERE condition to join between the 2 tables, DAIL_ATT, TRAIN_MAST.

    UPDATE DAIL_ATT A SET A.IDE_IN = (SELECT TO_NUMBER(TO_DATE(TO_CHAR(INTIME, 'DD-MON-YYYY')|| ' ' || TO_CHAR(0815, '0000'), 'DD-MON-YYYY HH24:MI') + LATE_HRS / (24 * 60) - INTIME) * 24 * 60 FROM TRAIN_MAST B WHERE );
    

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

  • Add more than 2 lines for a select statement without inserting rows in the base table

    Hi all

    I have a below a simple select statement that is querying a table.

    Select * from STUDY_SCHED_INTERVAL_TEMP
    where STUDY_KEY = 1063;

    but here's the situation. As you can see its return 7 ranks. But I must add
    2 rows more... with everything else, default or what exist... except the adding more than 2 lines.
    I can't insert in the base table. I want my results to end incrementing by 2 days in
    measurement_date_Taken on 01-APR-09... so big measurement_date_taken expected to
    end at study_end_Date...



    IS IT STILL POSSIBLE WITHOUT INSERT ROWS IN THE TABLE AND PLAYIHY ALL AROUND WITH
    THE SELECT STATEMENT?

    Sorry if this is confusing... I'm on 10.2.0.3

    Published by: S2K on August 13, 2009 14:19

    Well, I don't know if this request is as beautiful as my lawn, but seems to work even when ;)
    I used the "simplified" version, but the principle should work for your table, S2K.
    As Frank has already pointed out (and I fell on it while clunging): simply select your already existing lines and union them with the 'missing documents', you calculate the number of days that you are "missing" based on the study_end_date:

    MHO%xe> alter session set nls_date_language='AMERICAN';
    
    Sessie is gewijzigd.
    
    Verstreken: 00:00:00.01
    MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
      2  select 1063 study_key
      3  ,      to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
      4  ,      to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
      5  ,      to_date('01-APR-09', 'dd-mon-rr') study_end_date
      6  from dual union all
      7  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      8  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      9  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     10  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     11  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     12  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
     13  ) -- actual query:
     14  select study_key
     15  ,      phase_start_date
     16  ,      measurement_date_taken
     17  ,      study_end_date
     18  from   t
     19  union all
     20  select study_key
     21  ,      phase_start_date
     22  ,      measurement_date_taken + level -- or rownum
     23  ,      study_end_date
     24  from ( select study_key
     25         ,      phase_start_date
     26         ,      measurement_date_taken
     27         ,      study_end_date
     28         ,      add_up
     29         from (
     30                select study_key
     31                ,      phase_start_date
     32                ,      measurement_date_taken
     33                ,      study_end_date
     34                ,      study_end_date - max(measurement_date_taken) over (partition by study_key
     35                                                                          order by measurement_date_taken ) add_up
     36                ,      lead(measurement_date_taken) over (partition by study_key
     37                                                          order by measurement_date_taken ) last_rec
     38                from   t
     39              )
     40         where last_rec is null
     41       )
     42  where rownum <= add_up
     43  connect by level <= add_up;
    
     STUDY_KEY PHASE_START_DATE    MEASUREMENT_DATE_TA STUDY_END_DATE
    ---------- ------------------- ------------------- -------------------
          1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
    
    9 rijen zijn geselecteerd.
    

    Is there a simpler way (in SQL), I hope that others join, and share their ideas/example/thoughts.
    I feel that it is using more resources there.
    But I have to cut the daisies before now, they interfere my 'grass-green-ess";)

  • How to INSERT a SELECT statement with a GROUP BY clause on a table with an IDENTITY column?

    n an application, I intend to truncate and insertion on a 12 c Oracle database, but have found this problem with a IDENTITY column. Even if the INSERT... SELECT statement works on most SELECT uses I tried, if this statement was also a GROUP BY clause, it does not work, delivering a "ORA-00979: not a GROUP BY expression ' complaint. Some examples of code:

    create table aux ( owner_name varchar2(20), pet varchar2(20) ); 

    insert into aux values ('Scott', 'dog');

    insert into aux values ('Mike', 'dog');

    insert into aux values ('Mike', 'cat');

    insert into aux values ('John', 'turtle'); 


    create table T1 (

    id number generated always as identity,

    owner_name varchar2(20),

    pet_count number );

    select owner_name, count(*) as pet_count from aux group by owner_name; -- works just fine

    insert into T1 (owner_name, pet_count) select owner_name, count(*) as pet_count from aux group by owner_name; -- doesn't work

    The select statement works by itself, but it fails as an INSERT... SELECT statement.

    Appreciate the help!

    Looks like a bug. You must open the SR with Oracle. Meanwhile, you could materialize select:

    SQL > insert into T1 (owner_name, pet_count)
    2 with t as (select / * + materialize * / owner_name, count (*) as pet_count to the owner_name group)
    3. Select owner_name, pet_count t
    4.

    3 lines were created.

    SQL > select * from t1;

    ID OWNER_NAME PET_COUNT
    ---------- -------------------- ----------
    1 John                          1
    Scott 2 1
    3 Mike                          2

    SQL >

    Keep in mind index THAT MATERIALIZE is undocumented.

    SY.

  • How to write a select statement in which the condition?

    Hello Frs,

    Need help in the development of a discoverer report.

    My requirement is to write a query similar to this one

    Select * from emp is dept_no not in (select Department dept_no where emp_name like ' a % ;))

    Help, please.


    Thank you
    Rajesh

    Hello
    to do this exactly how you can do 1 of 3 things:
    1 use the Discoverer Desktop edition (most didn't do it) and use the sub query option you will find in the conditions.
    2. create a custom in the BA folder and create the report on the new custom folder
    3. create a view of db that contain your selection, and then create a folder in the BA based on this point of view and then create your report.

    Tamir

Maybe you are looking for