Is Increment and Decrement Operators Atomic?

Is there a need to synchronize increment and decrement operations, or they are atomic? If so, how about pre and post variations?

raychen wrote:
jverd wrote:
Simple rule: If multiple threads are accessing a variable, all access to that variable must be synchronized. There are exceptions, but you'll seldom go wrong by following that rule.I don't synchronize data member accesses in simple setters and getters, as JVM guarantees my read and write are atomic at the memory level. Am I making bad assumptions?Yup, you are. For a couple of reasons.
1. Reading and writing of non-volatile longs and doubles is not guaranteed atomic.
2. It also does NOT guarantee that one thread will ever even see a value written by another thread, however, unless either a) the variable is volatile, in which case threads don't have local copies all reads and writes go against the main copy, or b) access is synchronized and therefore the writing thread's local copy is flushed to main memory upon exiting exiting the sync block and the reading thread gets its first read after entering the sync block from the main copy.
Edited by: jverd on Jul 21, 2009 10:33 AM

Similar Messages

  • The Increment and Decrement Operators (++ and - - )

    Hi all !
    Even if i do understand how ++ and -- operators works fine (as a pre-modifers and post-modifers) but i can't understand how do they got the HIGHTEST precedence (unary operators) over than other operators , consider the follwing examples :
    Ex(1):
    ======
    initially : x = 5 & y = 0;
    y = x++ ;
    i know the process goes like this :
    - Evaluation : Left-to-Right (y is 0 and x is 5)
    - Operation : assignement of x to y , then increment x by 1.
    Q(1) is : why do assignment first then increment even if operator ++ has higher precendence than "=" operator.
    (i understand that that is true if y=++x, but why? ).
    Ex(2):
    ======
    initially : x=5 & y =0;
    y = x++ + 5;
    y now is 10 , x now is 6
    Q(2) is : even if the ++ operator is higher in precedence ,the arithmetic operator "+" is evaluated first, why?
    (same applies to the -- operator)
    Thanks ...

    Q(1) is : why do assignment first then increment even
    if operator ++ has higher precendence than "="
    operator.
    (i understand that that is true if y=++x, but why? ).The assignment is not performed first:
    (1) Memory is reserved to store the result of the expression on the right hand side.
    (2) The expression evaluates to the current value of x, which is 5. This value is stored away.
    (3) x is incremented, and is now equal to 6.
    (4) The value previously stored away is assigned to y. y is now 5.
    Q(2) is : even if the ++ operator is higher in
    precedence ,the arithmetic operator "+" is evaluated
    first, why?The + operator is not evaluated first:
    (1) Memory is reserved to store the result of the expression on the right hand side.
    (2) The current value of x is stored in that reserved memory. The value is 5.
    (3) x is incremented to 6.
    (4) 5 is added to the expression result, and the result is now 10.
    (5) The expression result is assigned to y. y is now 10.
    Note that the implementation is free to perform the calculation however it wishes, so long as it is done such that the user/programmer can not tell the difference.

  • Increment and decrement buttons on a ring control are greyed out

    Hello,
      The check box for showing the increment and decrement buttons on a ring control are greyed out. Does anyone know why? I have verified that the ring is a control as opposed to a indicator.
    Regards,
    Kaspar
    Regards,
    Kaspar

    "the controls are greyed out because they do not exist on the Menu ring control."
    Errr... yes, I believe that's exactly what I said in my last response.
    "This is different from what I saw in another part of this forum about using event structures on a Menu ring."
    Don't know what you could be referring to, as there is no event specific to the increment/decrement controls. All that they would do (if they existed) is to change the value of the control, and the applicable event would be the "Value changed" event. Where exactly did you read this?

  • Numeric Format with "dB" causes strange Increment and Decrement behavior

    To reproduce this, drop a numeric control in LabVIEW (Version 8.2 and later).
    Right click on the numeric control and select properties
    Select the "Format and Precision" tab
    Select the "Advanced editing mode" radio button
    Change the Format string to "%#_gdB" and press OK.
    Type "-123" into the numeric control.
    Place the cursor inbetween the 2 and 3.  Press the up arrow.  The normal response of the numeric is to increment the number to the left of the cursor, in this case the 2.  The expected number is -113.  However, with the "dB" in the format string, the number becomes -11.3.  This caused a problem with a Signal Generator whose power output (in Decibels) was controlled by this instrument.  in 2 keystrokes, the power went from -80dB to 0dB and almost damaged some equipment.
    The work around is to remove the dB from the format string or put it in parenthesis.  However, this seems like a bug.  If someone from National Instruments determines this is a bug, please post the CAR# to this thread.  Otherwise, it would be nice to have this behavior explained.

    Interesting behavior. I confirmed this with 8.2. What's more interesting is that the behavior is not consistent. If you use "Hz" the control works as you expected it to work. If you use "A", and perform the same steps, pressing the up arrow gets you "NaN". I tried putting a space before the "dB", and it made no difference. At first I thought that the "d" was being misinterpreted, but the result from using "A" made no sense. Very odd.
    Lesson learned from your experience: Always make sure to check the values that you want to set before you actually set them. You should have 2 layers of checking. The lowest level checks the values against the instrument's capabilities. In other words, making sure you don't try to program a level of 100 when the instrument can only handle 10. A higher level should check values against usage limits. This is where you put in the valid ranges for how you're using the instrument. For example, even though the instrument may be able to go to 13 dBm, in your testing you may only want a maximum setting of, say, -20 dBm. In my code I write a wrapper VI around each driver function to implement this. This requires extra code, but it can save your butt in many instances.

  • Increment and decrement with a Boolean input

    Hello Labview Experts (and life savers actually !!)
    In my VI ,I have  a numerical controller (knob) feeding a numerical indicator ,in addition to a bolean input.
    As an initial state the numerical indicator will contain a certain value (zero for example) and will only receive the variation in the knob input as long as the bolean input is true and then add it to this initial value.
    what is the variation ? lets say that the knob was on 8 before i hit the boolean true ,the indicator's value is zero ,and then I hit the boolean true ,
    Now ,when i move the knob from 8 to 18 (+10 variation) ,I want the indicator to receive +10 and add it to the zero ,now the result is 0+10=10.
    Now the boolean is false ,I move the knob and nothing happens to the 10 in the indicator.
    Now the boolean is true again ,let's to say the knob was on 4 at the time i hit the boolean true ,and I move it from 4 to 1 (-3 variation) ,the indicator's value now will be 10+ (-3) = 7
    I hope I explained the idea in a clear way ,I would be very thankful if someone would help me with that.
    P.S. I only attached the vi for illustrating the idea.
    Thanks in advance
    Solved!
    Go to Solution.
    Attachments:
    main components.vi ‏7 KB

    You only care about how much the knob changed.  Therefore, you need to subtract the old value and the new value to get how much the knob changed.  Then inside the case structure, add that difference to your value that belongs in the shift register.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Incremental_BD.png ‏7 KB

  • Increment and decrement to reach upper and lower limit

    I have to simulate a central heating system. A heater is turned on, room temp rises to 'upper limit'; heater is turned off when upper limit is reached. When heater is off, temp drops until lower limit is reached then heater is turned on again. I'm scratching my head!! have tried various case structures but cant get it to run continually. Whats the best way to do this? PS, im a noob! :-)

    Use a shift register to keep the current heater state (since you only want the state to change when you go outside of the limits).  From there, the Select function helps keep things straight.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Heater control.png ‏12 KB

  • Titled pane auto size increment and decrement  in resizing pbm

    hi can anyone help me in fixing this issue ,
    i am getting the problem i need the titled pane to be occupying the whole space of window or the space of split pane size .. when there is a resize..

    The answer was a simple property setting - sweet!
    <s:VScrollBar id="verticalScrollBar" visible="false" 
                       fixedThumbSize="true"
                      skinClass="com.sprycel.views.controls.ThumbOnlyVScrollBarSkin"/>

  • The plus(+) and minus(-) keys to increment or decrement the date

    Hi All,
    I have a date field in which I would like to have the + and - keys to increment or decrement the date as in some windows programs.
    Thank you, Bill

    Hi Chad, Yes I know the Date Picker... that is what it has now.
    My users are keyboard users... hitting the plus or minus sign in the Num Pad is much quicker if the date is only 2-3 day plus or minus...
    We desire to have the Date Picker and have maybe a onkey event call. I was hoping to find someone that has used "onkey" for a specific element/field so it doesn't look at every key stroke in the document but just the one date element onkeyup etc......
    Thanks for the response.
    Bill

  • ROLLUP AND CUBE OPERATORS IN ORACLE 8I

    제품 : PL/SQL
    작성날짜 : 2000-06-29
    ========================================
    ROLLUP AND CUBE OPERATORS IN ORACLE 8I
    ========================================
    PURPOSE
    ROLLUP 과 CUBE Operator에 대해 설명하고자 한다.
    Explanation
    ROLLUP operator는 SELECT문의 GROUP BY절에 사용된다.
    SELECT절에 ROLLUP 을 사용함으로써 'regular rows'(보통의 select된 data)와
    'super-aggregate rows'(총계)을 구할 수 있다. 기존에는 select ... union select
    를 이용해 구사해야 했었던 것이다. 'super-aggregate rows'는 'sub-total'
    (중간 Total, 즉 소계)을 포함한다.
    CUBE operator는 Cross-tab에 대한 Summary를 추출하는데 사용된다. 모든 가능한
    dimension에 대한 total을 나타낸다. 즉 ROLLUP에 의해 나타내어지는 item total값과
    column total값을 나타낸다.
    NULL값은 모든 값에 대한 super-aggregate 을 나타낸다. GROUPING() function은
    모든 값에 대한 set을 나타내는 null값과 column의 null값과 구별하는데 쓰여진다.
    GROUPING() function은 GROUP BY절에서 반드시 표현되어야 한다. GROUPING()은 모든
    값의 set을 표현합에 있어서 null이면 1을 아니면 0을 return한다.
    ROLLUP과 CUBE는 CREATE MATERIALIZED VIEW에서 사용되어 질수 있다.
    Example
    아래와 같이 테스트에 쓰여질 table과 data을 만든다.
    create table test_roll
    (YEAR NUMBER(4),
    REGION CHAR(7),
    DEPT CHAR(2),
    PROFIT NUMBER );
    insert into test_roll values (1995 ,'West' , 'A1' , 100);
    insert into test_roll values (1995 ,'West' , 'A2' , 100);
    insert into test_roll values (1996 ,'West' , 'A1' , 100);
    insert into test_roll values (1996 ,'West' , 'A2' , 100);
    insert into test_roll values (1995 ,'Central' ,'A1' , 100);
    insert into test_roll values (1995 ,'East' , 'A1' , 100);
    insert into test_roll values (1995 ,'East' , 'A2' , 100);
    SQL> select * from test_roll;
    YEAR REGION DE PROFIT
    1995 West A1 100
    1995 West A2 100
    1996 West A1 100
    1996 West A2 100
    1995 Central A1 100
    1995 East A1 100
    1995 East A2 100
    7 rows selected.
    예제 1: ROLLUP
    SQL> select year, region, sum(profit), count(*)
    from test_roll
    group by rollup(year, region);
    YEAR REGION SUM(PROFIT) COUNT(*)
    1995 Central 100 1
    1995 East 200 2
    1995 West 200 2
    1995 500 5
    1996 West 200 2
    1996 200 2
    700 7
    7 rows selected.
    위의 내용을 tabular로 나타내어 보면 쉽게 알 수 있다.
    Year Central(A1+A2) East(A1+A2) West(A1+A2)
    1995 (100+NULL) (100+100) (100+100) 500
    1996 (NULL+NULL) (NULL+NULL) (100+100) 200
    700
    예제 2: ROLLUP and GROUPING()
    SQL> select year, region, sum(profit),
    grouping(year) "Y", grouping(region) "R"
    from test_roll
    group by rollup (year, region);
    YEAR REGION SUM(PROFIT) Y R
    1995 Central 100 0 0
    1995 East 200 0 0
    1995 West 200 0 0
    1995 500 0 1
    1996 West 200 0 0
    1996 200 0 1
    700 1 1
    7 rows selected.
    참고) null값이 모든 값의 set에 대한 표현으로 나타내어지면 GROUPING function은
    super-aggregate row에 대해 1을 return한다.
    예제 3: CUBE
    SQL> select year, region, sum(profit), count(*)
    from test_roll
    group by cube(year, region);
    YEAR REGION SUM(PROFIT) COUNT(*)
    1995 Central 100 1
    1995 East 200 2
    1995 West 200 2
    1995 500 5
    1996 West 200 2
    1996 200 2
    Central 100 1
    East 200 2
    West 400 4
    700 7
    위의 내용을 tabular로 나타내어 보면 쉽게 알 수 있다.
    Year Central(A1+A2) East(A1+A2) West(A1+A2)
    1995 (100+NULL) (100+100) (100+100) 500
    1996 (NULL+NULL) (NULL+NULL) (100+100) 200
    100 200 400 700
    예제 4: CUBE and GROUPING()
    SQL> select year, region, sum(profit),
    grouping(year) "Y", grouping(region) "R"
    from test_roll
    group by cube (year, region);
    YEAR REGION SUM(PROFIT) Y R
    1995 Central 100 0 0
    1995 East 200 0 0
    1995 West 200 0 0
    1995 500 0 1
    1996 West 200 0 0
    1996 200 0 1
    Central 100 1 0
    East 200 1 0
    West 400 1 0
    700 1 1
    10 rows selected.
    ===============================================
    HOW TO USE ROLLUP AND CUBE OPERATORS IN PL/SQL
    ===============================================
    Release 8.1.5 PL/SQL에서는 CUBE, ROLLUP 이 지원되지 않는다. 8i에서는 DBMS_SQL
    package을 이용하여 dynamic SQL로 구현하는 방법이 workaround로 제시된다.
    Ordacle8i에서는 PL/SQL block에 SQL절을 직접적으로 위치시키는 Native Dynamic SQL
    (참고 bul#11721)을 지원한다.
    Native Dynamic SQL을 사용하기 위해서는 COMPATIBLE 이 8.1.0 또는 그 보다 높아야
    한다.
    SVRMGR> show parameter compatible
    NAME TYPE VALUE
    compatible string 8.1.0
    예제 1-1: ROLLUP -> 위의 예제 1과 비교한다.
    SQL> create or replace procedure test_rollup as
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    begin
    select year, region, sum(profit), count(*)
    into my_year, my_region, my_sum, my_count
    from test_roll
    group by rollup(year, region);
    end;
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE TEST_ROLLUP:
    LINE/COL ERROR
    10/8 PL/SQL: SQL Statement ignored
    13/18 PLS-00201: identifier 'ROLLUP' must be declared
    SQL> create or replace procedure test_rollup as
    type curTyp is ref cursor;
    sql_stmt varchar2(200);
    tab_cv curTyp;
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    begin
    sql_stmt := 'select year, region, sum(profit), count(*) ' ||
    'from test_roll ' ||
    'group by rollup(year, region)';
    open tab_cv for sql_stmt;
    loop
    fetch tab_cv into my_year, my_region, my_sum, my_count;
    exit when tab_cv%NOTFOUND;
    dbms_output.put_line (my_year || ' '||
    nvl(my_region,' ') ||
    ' ' || my_sum || ' ' || my_count);
    end loop;
    close tab_cv;
    end;
    SQL> set serveroutput on
    SQL> exec test_rollup
    1995 Central 100 1
    1995 East 200 2
    1995 West 200 2
    1995 500 5
    1996 West 200 2
    1996 200 2
    700 7
    PL/SQL procedure successfully completed.
    예제 2-1: ROLLUP and GROUPING() -> 위의 예제 2와 비교한다.
    SQL> create or replace procedure test_rollupg as
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    my_g_region int;
    my_g_year int;
    begin
    select year, region, sum(profit),
    grouping(year), grouping(region)
    into my_year, my_region, my_sum, my_count,
    my_g_year, my_g_region
    from test_roll
    group by rollup(year, region);
    end;
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE TEST_ROLLUPG:
    LINE/COL ERROR
    12/4 PL/SQL: SQL Statement ignored
    17/13 PLS-00201: identifier 'ROLLUP' must be declared
    SQL> create or replace procedure test_rollupg as
    type curTyp is ref cursor;
    sql_stmt varchar2(200);
    tab_cv curTyp;
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    my_g_region int;
    my_g_year int;
    begin
    sql_stmt := 'select year, region, sum(profit), count(*), ' ||
    'grouping(year), grouping(region) ' ||
    'from test_roll ' ||
    'group by rollup(year, region)';
    open tab_cv for sql_stmt;
    loop
    fetch tab_cv into my_year, my_region, my_sum, my_count,
    my_g_year, my_g_region;
    exit when tab_cv%NOTFOUND;
    dbms_output.put_line (my_year || ' '||my_region ||
    ' ' || my_sum || ' ' || my_count ||
    ' ' || my_g_year || ' ' || my_g_region);
    end loop;
    close tab_cv;
    end;
    Procedure created.
    SQL> set serveroutput on
    SQL> exec test_rollupg
    1995 Central 100 1 0 0
    1995 East 200 2 0 0
    1995 West 200 2 0 0
    1995 500 5 0 1
    1996 West 200 2 0 0
    1996 200 2 0 1
    700 7 1 1
    PL/SQL procedure successfully completed.
    예제 3-1: CUBE -> 위의 예제 3과 비교한다.
    SQL> create or replace procedure test_cube as
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    begin
    select year, region, sum(profit), count(*)
    into my_year, my_region, my_sum, my_count
    from test_roll
    group by cube(year, region);
    end;
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE TEST_CUBE:
    LINE/COL ERROR
    10/4 PL/SQL: SQL Statement ignored
    13/13 PLS-00201: identifier 'CUBE' must be declared
    SQL> create or replace procedure test_cube as
    type curTyp is ref cursor;
    sql_stmt varchar2(200);
    tab_cv curTyp;
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    begin
    sql_stmt := 'select year, region, sum(profit), count(*) ' ||
    'from test_roll ' ||
    'group by cube(year, region)';
    open tab_cv for sql_stmt;
    loop
    fetch tab_cv into my_year, my_region, my_sum, my_count;
    exit when tab_cv%NOTFOUND;
    dbms_output.put_line (my_year || ' '||
    nvl(my_region,' ') ||
    ' ' || my_sum || ' ' || my_count);
    end loop;
    close tab_cv;
    end;
    Procedure created.
    SQL> set serveroutput on
    SQL> exec test_cube
    1995 Central 100 1
    1995 East 200 2
    1995 West 200 2
    1995 500 5
    1996 West 200 2
    1996 200 2
    Central 100 1
    East 200 2
    West 400 4
    700 7
    PL/SQL procedure successfully completed.
    예제 4-1: CUBE and GROUPING() -> 위의 예제 4와 비교한다.
    SQL> create or replace procedure test_cubeg as
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    my_g_region int;
    my_g_year int;
    begin
    select year, region, sum(profit),
    grouping(year), grouping(region)
    into my_year, my_region, my_sum, my_count,
    my_g_year, my_g_region
    from test_roll
    group by cube(year, region);
    end;
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE TEST_CUBEG:
    LINE/COL ERROR
    12/4 PL/SQL: SQL Statement ignored
    17/13 PLS-00201: identifier 'CUBE' must be declared
    SQL> create or replace procedure test_cubeg as
    type curTyp is ref cursor;
    sql_stmt varchar2(200);
    tab_cv curTyp;
    my_year test_roll.year%type;
    my_region test_roll.region%type;
    my_sum int;
    my_count int;
    my_g_region int;
    my_g_year int;
    begin
    sql_stmt := 'select year, region, sum(profit), count(*), ' ||
    'grouping(year), grouping(region) ' ||
    'from test_roll ' ||
    'group by cube(year, region)';
    open tab_cv for sql_stmt;
    loop
    fetch tab_cv into my_year, my_region, my_sum, my_count,
    my_g_year, my_g_region;
    exit when tab_cv%NOTFOUND;
    dbms_output.put_line (my_year || ' '||my_region ||
    ' ' || my_sum || ' ' || my_count ||
    ' ' || my_g_year || ' ' || my_g_region);
    end loop;
    close tab_cv;
    end;
    Procedure created.
    SQL> set serveroutput on
    SQL> exec test_cubeg
    1995 Central 100 1 0 0
    1995 East 200 2 0 0
    1995 West 200 2 0 0
    1995 500 5 0 1
    1996 West 200 2 0 0
    1996 200 2 0 1
    Central 100 1 1 0
    East 200 2 1 0
    West 400 4 1 0
    700 7 1 1
    PL/SQL procedure successfully completed.
    Reference Ducumment
    Note:67988.1

    Hello,
    As previously posted you should use export and import utilities.
    To execute exp or imp statements you have just to open a command line interface, for instance,
    a DOS box on Windows.
    So you don't have to use SQL*Plus or TOAD.
    About export/import you may care on the mode, to export a single or a list of Tables the Table mode
    is enough.
    Please, find here an example to begin:
    http://wiki.oracle.com/page/Oracle+export+and+import+
    Hope this help.
    Best regards,
    Jean-Valentin

  • Difference between  exists and in operators in oracle?

    what is difference between exists and in operators in oracle?
    what is faster and why?

    Malli wrote:
    what is difference between exists and in operators in oracle?
    what is faster and why?Is this a homework question?
    Have you done any tests yourself to see which is faster?

  • Difference between ANY and ALL operators

    I am learning the basics of ANY and ALL operators.
    Retrieving all employees in Dept 30 whose sal is greater than ANY employees in Dept 20
    SQL> SELECT * FROM EMP;
         EMPNO ENAME           JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH           CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN           SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD            SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES           MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN          SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE           MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK           MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT           ANALYST         7566 19-APR-87       3000                    20
          7839 KING            PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER          SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS           CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME           JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES           CLERK           7698 03-DEC-81        950                    30
          7902 FORD            ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER          CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> SELECT * FROM EMP WHERE DEPTNO=20;
         EMPNO ENAME           JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH           CLERK           7902 17-DEC-80        800                    20
          7566 JONES           MANAGER         7839 02-APR-81       2975                    20
          7788 SCOTT           ANALYST         7566 19-APR-87       3000                    20
          7876 ADAMS           CLERK           7788 23-MAY-87       1100                    20
          7902 FORD            ANALYST         7566 03-DEC-81       3000                    20
    SQL> SELECT * FROM EMP WHERE DEPTNO=30;
         EMPNO ENAME           JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7499 ALLEN           SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD            SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN          SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE           MANAGER         7839 01-MAY-81       2850                    30
          7844 TURNER          SALESMAN        7698 08-SEP-81       1500          0         30
          7900 JAMES           CLERK           7698 03-DEC-81        950                    30
    6 rows selected.
    SQL> SELECT * FROM EMP
      2  WHERE SAL>ALL
      3  (SELECT SAL FROM
      4  EMP WHERE DEPTNO=20)
      5  AND DEPTNO=30;
    no rows selected
    SQL> SELECT * FROM EMP
      2   WHERE SAL>ANY
      3   (SELECT SAL FROM
      4   EMP WHERE DEPTNO=20)
      5   AND DEPTNO=30;
         EMPNO ENAME           JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7698 BLAKE           MANAGER         7839 01-MAY-81       2850                    30
          7499 ALLEN           SALESMAN        7698 20-FEB-81       1600        300         30
          7844 TURNER          SALESMAN        7698 08-SEP-81       1500          0         30
          7521 WARD            SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN          SALESMAN        7698 28-SEP-81       1250       1400         30
          7900 JAMES           CLERK           7698 03-DEC-81        950                    30
    6 rows selected.From a book by Damir Bersinic:
    An easy shorthand enables you to remember the distinction between ANY and
    ALL. If a query condition is >ANY, each row in the result set is greater than the lowest value returned. When a query is >ALL, each row in the result set is greater than the highest value returned.
    He meant ; If a query condition is >ANY, each row in the result set is greater than the lowest value returned by the subquery. Didn't he?
    I couldn't find ANY and ALL operators in 10g SQL Reference? Are these operators being replaced by anything?
    Message was edited by:
    for_good_reason

    Look this
    >ANY------- means more than minimum
    Ex: sql> select empno,ename,job from emp
    where sal>ANY(select sal from emp job='CLERK');
    w/o using >ANY the query will be
    sql>select empno,ename,job from emp
    where sal>(select min(sal) from emp job='CLERK');
    >ALL-------- means more than the maximum
    Ex: sql> select empno,ename, job sal from emp
    where sal> ALL(select Avg(sal) from emp Group by deptno);
    w/o using >ALL the query will be
    sql> select empno,ename, job sal from emp
    where sal> (select max(Avg(sal)) from emp Group by deptno);
    sandeep

  • Increment and Save command

    The "Increment and Save" command in After Effects serves the fundamental need in professional creative work of preserving the various development stages of a job. Cinema 4D and other pro software packages also have this. Illustrator should too.

    Autosaviour Pro auto saves your Adobe Illustrator artwork
    and they have incremental backups.

  • Integer division and remainder operators help

    I am trying to write a program to that inputs angle measurements for two angles (each measurement requires you to input 3 values) and then adds the two angles together and prints out the resulting angle. I am having problems with the math I can't use the "If" statement just integer division and remainder operators here is what I have.
    import java.util.Scanner;
    public class Angles
         public static void main (String[] args)
              Scanner scan = new Scanner(System.in);
              // takes the first angles from the user
              System.out.print("Enter the Degrees of the first angle < 360: ");
              int Angle1 = scan.nextInt();
              // takes the first minutes from the user
              System.out.print("Enter the Minutes of the first angle < 60: ");
              int Minutes1 = scan.nextInt();
              // takes the first seconds from the user
              System.out.print("Enter the Seconds of the first angle < 60: ");
              int Seconds1 = scan.nextInt();
              // takes the second angles from the user
              System.out.print("Enter the Degrees of the second angle < 360: ");
              int Angle2 = scan.nextInt();
              // takes the second minutes from the user
              System.out.print("Enter the Minutes of the second angle < 60: ");
              int Minutes2 = scan.nextInt();
              // takes the second seconds from the user
              System.out.print("Enter the Seconds of the second angle < 60: ");
              int Seconds2 = scan.nextInt();
              // adds the seconds
              int SecondsTotal = (Seconds1 + Seconds2);
              SecondsTotal =      SecondsTotal % 60;
              // adds the minutes
              int MinutesTotal = (Minutes1 + Minutes2 + (SecondsTotal % 60));
              MinutesTotal = MinutesTotal % 60;          
              // adds the angles
              int AngleTotal = (Angle1 + Angle2 + (MinutesTotal % 60));
              AngleTotal = AngleTotal % 360;
              // prints the angles, minutes, seconds to the user
              System.out.print(Angle1 + "deg" + Minutes1 + "'" + Seconds1 + "'' + " + Angle2 + "deg" + Minutes2 + "'" + Seconds2 + "'' + " + " = " + AngleTotal + " " + MinutesTotal + " " + SecondsTotal);
    }

    Ok I changed my code everything is working except for the roll over when angle reaches 360 it should go to 0.
    import java.util.Scanner;
    public class Angles
         public static void main (String[] args)
              Scanner scan = new Scanner(System.in);
              // takes the first angles from the user
              System.out.print("Enter the Degrees of the first angle < 360: ");
              int Angle1 = scan.nextInt();
              // takes the first minutes from the user
              System.out.print("Enter the Minutes of the first angle < 60: ");
              int Minutes1 = scan.nextInt();
              // takes the first seconds from the user
              System.out.print("Enter the Seconds of the first angle < 60: ");
              int Seconds1 = scan.nextInt();
              // takes the second angles from the user
              System.out.print("Enter the Degrees of the second angle < 360: ");
              int Angle2 = scan.nextInt();
              // takes the second minutes from the user
              System.out.print("Enter the Minutes of the second angle < 60: ");
              int Minutes2 = scan.nextInt();
              // takes the second seconds from the user
              System.out.print("Enter the Seconds of the second angle < 60: ");
              int Seconds2 = scan.nextInt();
              // adds the seconds
              int SecondsTotal = (Seconds1 + Seconds2);
              // adds the minutes
              int MinutesTotal = (Minutes1 + Minutes2);
              // adds the angles
              int AngleTotal = (Angle1 + Angle2);
              // calculates the minutes
              MinutesTotal = MinutesTotal + SecondsTotal / 60;
              // calculates the angle
              AngleTotal = AngleTotal + MinutesTotal / 60;
              // caculates the final angle, minutes, seconds
              MinutesTotal = MinutesTotal % 60;
              SecondsTotal = SecondsTotal % 60;          
              AngleTotal = AngleTotal % 360;
              // prints the angles, minutes, seconds to the user
              System.out.print(Angle1 + "deg" + Minutes1 + "'" + Seconds1 + "'' + " + Angle2 + "deg" + Minutes2 +
                   "'" + Seconds2 + "'' + " + " = " + AngleTotal + " " + MinutesTotal + " " + SecondsTotal);
    }[Edit]I got it all I had to do was add:
    AngleTotal = AngleTotal % 360;Thanks for the help.
    Edited by: KillerZ123 on Oct 7, 2009 7:04 PM

  • Moving constructors and assignment operators

    Do moving constructors and assignment operators have been implemented in the latest (july) beta or SolarisStudio 12.4?
    Thanks in advance.

    Please help because it's still not working for me:
    #include <cstdlib>
    using namespace std;
    class Thing {
    public:
        Thing();
        Thing(Thing&&);
    private:
        Thing(const Thing&);
    Thing f() {
        Thing t;
        return t; // OK: Thing(Thing&&) used (or elided) to return t
    int main(int argc, char** argv) {
        Thing t2 = f();
        return 0;
    Here's the build window output:
    dmake: defaulting to parallel mode.
    See the man page dmake(1) for more information on setting up the .dmakerc file.
    "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/bin/dmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
    "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/bin/dmake"  -f nbproject/Makefile-Debug.mk dist/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86/thing
    mkdir -p build/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86
    CC    -c -g -std=c++11 -o build/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86/main.o main.cpp
    mkdir -p build/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86
    CC    -c -g -std=c++11 -o build/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86/main.o main.cpp
    "main.cpp", line 30: Error: Thing::Thing(const Thing&) is not accessible from f().
    1 Error(s) detected.
    *** Error code 2
    dmake: Fatal error: Command failed for target `build/Debug/OracleSolarisStudio_12.4_Beta2-Solaris-x86/main.o'
    Current working directory /home/prime/NetBeansProjects/thing
    *** Error code 1
    dmake: Fatal error: Command failed for target `.build-conf'
    Current working directory /home/prime/NetBeansProjects/thing
    *** Error code 1
    dmake: Fatal error: Command failed for target `.build-impl'
    BUILD FAILED (exit value 1, total time: 4s)
    Thanks in advance.

  • Increment and Save

    Is there an increment and save and I just don't see it and if not would it be possible to add this?

    MM, I understand your suggestions, yet none of them really suits my needs.
    The option that gets the closest is auto-save but then I am back in the situation that I don't like where I have to blindly trust an automated feature
    The thing is, I started editing wedding videos. I don't do the "main" edit that the couple will upload to social media etc, I rather work on turning the bulk of the wedding day (6-10hours of video) into one hour for the family to watch later.
    If this is to be lucrative for me, I need to be able to do at least one of said videos per day!!
    Thus, I am looking for any and all features that will save time and distraction (as well as discomfort) - filenaming and pop-up box clicking being one of them ( I don't use the mouse much while working on the most timeconsuming part - the trimming)
    I am alone in this situation?
    And again, is it something that can be scripted?

Maybe you are looking for

  • ITunes error 8003 and dowloads restart at 0

    I have been trying to download Discovery Atlas Italy for several weeks. I have a very poor internet connection that is maybe in the neighborhood of 128 k. I keep getting error 8003 while I am downloading the file and it resets to 0. The most I have b

  • Equivalent to "Use Joining" of TopLink in EJB3?

    Hi, In order to optimize querys of related objects in EJB3 (or JPA): Exists some mapping option equivalent to the Join Reading ("Use Joining" check box in JDeveloper 10g R3) of TopLink 10.1.3? Thans for your help. Regards.

  • Widget Browser -- nothing new since jANUARY, 2012???

    Has the widget Browser been discontinued? I don't see any new entries since January 2012...

  • Oracle Client 9.2.0.7 - from where ?

    Hi, Where can i find Oracle Client 9i ver. 9.2.0.7 for download ? I can't find it on OTN Database Download page for 9i (there is a 9.2.0.1 Client software only). Maybe should i download Client ver 9.2.0.1 and upgrade it ... but, here is next question

  • Passed Microsoft exam- Received MCID but there is no Access code

    Hi , Recently i completed Microsoft certification. I received a mail with MCID, and they havn't provided access code. however in the site there is an option we can generate temporary access code with MCID. i tried it but it is giving error like " una