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 = oracle::Connection::new("scott", "tiger", "").unwrap(); let objtype = conn.object_type("MDSYS.SDO_GEOMETRY");
Gets object type infomration in query.
let conn = oracle::Connection::new("scott", "tiger", "").unwrap(); // conn.execute("create table location (name varchar2(60), loc sdo_geometry)", &[]); let mut stmt = conn.execute("select loc from location where name = '...'", &[]).unwrap(); let objtype = if let oracle::OracleType::Object(ref objtype) = *stmt.column_info()[0].oracle_type() { objtype } else { panic!("Not an object type") };
Methods
impl ObjectType
[src]
fn schema(&self) -> &String
[src]
Gets schema name
fn name(&self) -> &String
[src]
Gets object name
fn is_collection(&self) -> bool
[src]
True when it is a collectoin. Otherwise false.
fn element_oracle_type(&self) -> Option<&OracleType>
[src]
Gets the Oracle type of elements if it is a collection.
Otherwise, None
.
fn num_attributes(&self) -> usize
[src]
Gets the number of attributes if it isn't a collection. Otherwise, 0.
fn attributes(&self) -> &Vec<ObjectTypeAttr>
[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 = oracle::Connection::new("scott", "tiger", "").unwrap(); let objtype = conn.object_type("MDSYS.SDO_GEOMETRY").unwrap(); for attr in objtype.attributes() { println!("{:-20} {}", attr.name(), attr.oracle_type()); }
fn new_object(&self) -> Option<Object>
[src]
Create a new Oracle object.
fn new_collection(&self) -> Option<Collection>
[src]
Create a new collection.
Trait Implementations
impl Clone for ObjectType
[src]
fn clone(&self) -> ObjectType
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for ObjectType
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Display for ObjectType
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more