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: How to begin a transaction PART III

Re: How to begin a transaction PART III

From: Louis Parsons <louisparsons_at_starband.net>
Date: Fri, 08 Feb 2002 17:16:50 GMT
Message-ID: <3C63FB8B.8060201@starband.net>


Your table has a locked row. Use a cursor:

DECLARE

CURSOR updateit(in_var	IN <whatever>) IS
	SELECT stuff FROM tablename1
			WHERE FieldPK = in_var
		FOR UPDATE OF field1 NOWAIT;
		-- the NOWAIT is the key
	 invar 
	<whatever>;

BEGIN
invar := <key value>;
OPEN updateit(in_var);
Fetch updateit into stuff;
update tablename1 set field1 = 'newvalue' where current of updateit;

EXCEPTION WHEN

-- at this point, if the row you are trying to update is locked,
-- the code will go here to your exception clause.  you must
-- trap the "row locked" exception and take action.



Carlos Hernández wrote:

> Hi, (and sorry).
>
> I need understand how to modified the Isolation Level of transaction.
>
> The problem is:
>
> Via Forms Developer locks a registry automatically.
>
> Via SQL Plus -> Update TableName1 Set Field1='NewValue' Where FieldPK='Key';
>
> SQL Plus remains ZOOMBIE .... with the statement UPDATE SQL.
>
> Any idea? SQL PLus not returns any ORA o PL- Error?
>
> Thanks and best regards.
>
> Carlos Hernández
> Barcelona (Spain)
>
>
>
>
>
Received on Fri Feb 08 2002 - 11:16:50 CST

Original text of this message

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