pub struct Object { /* private fields */ }
Expand description
Oracle-specific object data type
let conn = Connection::connect("scott", "tiger", "")?;
// MDSYS.SDO_GEOMETRY
// https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-683FF8C5-A773-4018-932D-2AF6EC8BC119
let geom_type = conn.object_type("MDSYS.SDO_GEOMETRY")?;
let point_type = conn.object_type("MDSYS.SDO_POINT_TYPE")?;
// Create a new object
let mut obj = geom_type.new_object()?;
let mut point = point_type.new_object()?;
point.set("X", &-79)?;
point.set("Y", &37)?;
obj.set("SDO_GTYPE", &2001)?;
obj.set("SDO_POINT", &point)?;
assert_eq!(obj.to_string(), "MDSYS.SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(-79, 37, NULL), NULL, NULL)");
// Gets an attribute value.
let gtype: i32 = obj.get("SDO_GTYPE")?;
assert_eq!(gtype, 2001);
Note: Methods in the type may be changed in future.