Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Fine point on rowtype and update
"nullpointer" <null_pointer_at_rediffmail.com> wrote in message
news:c0728f9d.0408192205.4a4dbfb2_at_posting.google.com...
> Just wondering if its a good idea to update using the rowtype
> variable. You might end up updating the primary key.
>
> Any thoughts ??
Hi
First of all, it is important to understand that this is a PL/SQL feature. Therefore, the PL/SQL engine will send to the SQL engine a statement like the following one.
UPDATE emp SET EMPNO = :b1,ENAME = :b2,JOB = :b3,MGR = :b4,HIREDATE = :b5,SAL = :b6,COMM = :b7,DEPTNO = :b8 WHERE empno=4711
Then, when Oracle executes such a statement, it will not update an index, if it is not necessary. They probably check the columns when they modify the data and only modify an index if the value is changed.
Chris
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=