Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Update Question If the Data is The Same
It does the update.
Proof?
C:\Documents and Settings\Howard>sqlplus scott/tiger_at_db9
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Oct 12 11:44:30 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
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
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> set autotrace on statistics;
SQL> update emp set sal=800 where empno=7369;
1 row updated.
Statistics
2 recursive calls 3 db block gets 2 consistent gets 1 physical reads 632 redo size 617 bytes sent via SQL*Net to client 535 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 2 sorts (memory) 0 sorts (disk) 1 rows processed
Note that this generated some redo, block gets and consistent gets. It did work on the database, even though it didn't really change anything from (y)our perspective.
Regards
HJR
"Niko" <nick_wakefield_at_hotmail.com> wrote in message
news:9da94cd1.0210111725.1a57c730_at_posting.google.com...
> Hi,
>
> Does anyone know that what the database does if you do an update and
> the value you are setting is the same as what you are setting it to.
>
> e.g
>
> SALES
> ID, VALUE
> 1 1000
> 2 2000
>
>
> update SALES set VALUE = 1000 where ID = 1;
>
> Does it not do the update or will it actually do the update eventhough
> the data is the same.
>
> TIA
Received on Fri Oct 11 2002 - 20:47:43 CDT