Forum Stats

  • 3,872,770 Users
  • 2,266,471 Discussions


Object Types: modify_object_attribute() function

User_1871 Member Posts: 247 Red Ribbon

Could Oracle consider creating a OOTB function that would let us assign an object type's attribute — within the SELECT clause of a query?

For example:

modify_object_attribute(object, attribute_name, new_val) returns object

modify_object_attribute(my_sdo_geom, sdo_gtype, 3306) returns sdo_geometry

More info here: Modify object attribute/property — without creating custom function


Yes, it's possible to do that kind of thing in a custom function or an inline function. But there are cases where we don't want to create a custom function or an inline function. An OOTB Oracle function would be simpler/preferred.

(I'm far from an expert. So I might have misunderstood something.)

1 votes

Active · Last Updated


  • mathguy
    mathguy Member Posts: 10,879 Black Diamond

    One obvious obstacle is the return data type. You seem to want a single function that would work for all object types (all "classes"). Since the return type of the function must be the same as the type of the first argument, it's not clear how this would work even with overloading; you presumably would want it to work for user-defined types too, not just for Oracle-provided types.