Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Fine point on rowtype and update

Re: Fine point on rowtype and update

From: Christian Antognini <christian.antognini_at_trivadis.com>
Date: Fri, 20 Aug 2004 10:05:49 +0200
Message-ID: <4125b0cd$1@post.usenet.com>

"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

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Received on Fri Aug 20 2004 - 03:05:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US