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

Home -> Community -> Usenet -> c.d.o.misc -> IN PLACE UPDATE of an object type?

IN PLACE UPDATE of an object type?

From: Michael Schaefers <schaefe3_at_cs.uni-bonn.spam-remove.de>
Date: Thu, 03 Feb 2005 12:45:50 +0100
Message-ID: <ctt2tf$phe$1@f1node01.rhrz.uni-bonn.de>


Consider the following example TYPE:

CREATE TYPE foo AS OBJECT (

	state INT,
	b BLOB,
	
	MEMBER FUNCTION difficultFunc RETURN INT,
	MEMBER FUNCTION easyFunc RETURN INT

);

This foo-type saves some data in its BLOB "b". This data can be stored in an unstructured (easy) an in a structured (difficult to build) way. The state (structured / unstructured) is stored in "state". For the MEMBER FUNCTION "easyFunc" it does not matter which state the "foo" instance is in. MEMBER FUNCTION "difficultFunc" needs structured data in BLOB "b". So it first checks the "state" and might then have to rearrange the data in the BLOB _on demand_.

This leads to the following problem:
Since the foo instance which is used in the member function "difficultFunc" is only a _copy_ of the one that is actually stored in the table column, the attribute "state" is not altered in the database as long as we do not perform an UPDATE on the appropriate table.

!!!BUT: Both foo instances work on the same BLOB and therefore the instance stored in the database has become inconsistent: the "state" attribute says "unstructured", but the BLOB data is "structured"!!!

What I would need is an update of my foo instance IN PLACE.

Does anybody have an idea how to alter the foo instance on the database without having to perform an explicit UPDATE statement?

I am using Oracle 10i on a Linux machine.

Regards,
Michael Schaefers Received on Thu Feb 03 2005 - 05:45:50 CST

Original text of this message

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