Struct oracle::Object [] [src]

pub struct Object { /* fields omitted */ }

Oracle-specific object data type

let conn = Connection::connect("scott", "tiger", "", &[]).unwrap();

// MDSYS.SDO_GEOMETRY
// https://docs.oracle.com/en/database/oracle/oracle-database/12.2/spatl/spatial-datatypes-metadata.html#GUID-683FF8C5-A773-4018-932D-2AF6EC8BC119
let geom_type = conn.object_type("MDSYS.SDO_GEOMETRY").unwrap();
let point_type = conn.object_type("MDSYS.SDO_POINT_TYPE").unwrap();

// Create a new object
let mut obj = geom_type.new_object().unwrap();
let mut point = point_type.new_object().unwrap();
point.set("X", &-79).unwrap();
point.set("Y", &37).unwrap();
obj.set("SDO_GTYPE", &2001).unwrap();
obj.set("SDO_POINT", &point).unwrap();
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").unwrap();
assert_eq!(gtype, 2001);

Note: Methods in the type may be changed in future.

Methods

impl Object
[src]

[src]

Returns type information.

[src]

Gets an value at the specified attribute.

[src]

Sets the value to the specified attribute.

Trait Implementations

impl Clone for Object
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Drop for Object
[src]

[src]

Executes the destructor for this type. Read more

impl FromSql for Object
[src]

impl ToSql for Object
[src]

[src]

[src]

impl Display for Object
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for Object
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for Object

impl !Sync for Object