views:

81

answers:

1

I want to be able to update a subtype attribute, and some research has led me to believe it can be done with TREAT. I have tried a couple of variations on this syntax:

UPDATE table1 t SET TREAT(VALUE(t) AS myType).attributeToUpdate = 10 WHERE id=1;

myType is a subtype of the type of table1.

Keep getting the error ORA-00927 missing equals sign.

Thanks

A: 

I never use any of this bizarre "tables of objects" stuff so can't be sure, but it seems to me that TREAT is an expression, and you can't update the result of any expression, e.g. this is obviously illegal:

UPDATE emp SET UPPER(ename) = 'X'; -- Won't work
Tony Andrews