Struct oracle::ObjectType [] [src]

pub struct ObjectType { /* fields omitted */ }

Type information about Object or Collection data type

This is for not only Object type information but also collection type information.

Examples

Gets MDSYS.SDO_GEOMETRY object type information.

let conn = Connection::connect("scott", "tiger", "", &[])?;
let objtype = conn.object_type("MDSYS.SDO_GEOMETRY");

Gets object type infomration in query.

let conn = Connection::connect("scott", "tiger", "", &[])?;
// conn.execute("create table location (name varchar2(60), loc sdo_geometry)", &[]);
let mut stmt = conn.prepare("select loc from location where name = '...'", &[])?;
let rows = stmt.query(&[])?;
let objtype = if let OracleType::Object(ref objtype) = *rows.column_info()[0].oracle_type() {
    objtype
} else {
    panic!("Not an object type")
};

Methods

impl ObjectType
[src]

[src]

Gets schema name

[src]

Gets object name

[src]

True when it is a collectoin. Otherwise false.

[src]

Gets the Oracle type of elements if it is a collection. Otherwise, None.

[src]

Gets the number of attributes if it isn't a collection. Otherwise, 0.

[src]

Gets a vector of attribute information if it isn't a collection. Otherwise, a zero-length vector.

Examples

Prints attribute information of MDSYS.SDO_GEOMETRY.

let conn = Connection::connect("scott", "tiger", "", &[])?;
let objtype = conn.object_type("MDSYS.SDO_GEOMETRY")?;
for attr in objtype.attributes() {
    println!("{:-20} {}", attr.name(), attr.oracle_type());
}

[src]

Create a new Oracle object.

[src]

Create a new collection.

Trait Implementations

impl Clone for ObjectType
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for ObjectType
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Display for ObjectType
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for ObjectType
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for ObjectType

impl !Sync for ObjectType