Struct oracle::ColumnInfo [−][src]
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]
impl ColumnInfo
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
Gets column name
pub fn oracle_type(&self) -> &OracleType
[src]
pub fn oracle_type(&self) -> &OracleType
Gets Oracle type
pub fn nullable(&self) -> bool
[src]
pub fn nullable(&self) -> bool
Gets whether the column may be NULL.
False when the column is defined as NOT NULL
.
Trait Implementations
impl Debug for ColumnInfo
[src]
impl Debug for ColumnInfo
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for ColumnInfo
[src]
impl Clone for ColumnInfo
fn clone(&self) -> ColumnInfo
[src]
fn clone(&self) -> ColumnInfo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Display for ColumnInfo
[src]
impl Display for ColumnInfo
Auto Trait Implementations
impl !Send for ColumnInfo
impl !Send for ColumnInfo
impl !Sync for ColumnInfo
impl !Sync for ColumnInfo