[][src]Struct oracle::ColumnInfo

pub struct ColumnInfo { /* fields omitted */ }

Column information in a select statement

Examples

Print column information of emp table.

let conn = Connection::connect("scott", "tiger", "")?;
let mut stmt = conn.prepare("select * from emp", &[])?;
let rows = stmt.query(&[])?;
println!(" {:-30} {:-8} {}", "Name", "Null?", "Type");
println!(" {:-30} {:-8} {}", "------------------------------", "--------", "----------------------------");
for info in rows.column_info() {
   println!("{:-30} {:-8} {}",
            info.name(),
            if info.nullable() {""} else {"NOT NULL"},
            info.oracle_type());
}

The output is:

 Name                           Null?    Type
 ------------------------------ -------- ----------------------------
 EMPNO                          NOT NULL NUMBER(4)
 ENAME                                   VARCHAR2(10)
 JOB                                     VARCHAR2(9)
 MGR                                     NUMBER(4)
 HIREDATE                                DATE
 SAL                                     NUMBER(7,2)
 COMM                                    NUMBER(7,2)
 DEPTNO                                  NUMBER(2)

Methods

impl ColumnInfo[src]

pub fn name(&self) -> &str[src]

Gets column name

pub fn oracle_type(&self) -> &OracleType[src]

Gets Oracle type

pub fn nullable(&self) -> bool[src]

Gets whether the column may be NULL. False when the column is defined as NOT NULL.

Trait Implementations

impl Clone for ColumnInfo[src]

impl Debug for ColumnInfo[src]

impl Display for ColumnInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Err = <U as TryFrom<T>>::Err