Struct oracle::ColumnInfo
source · pub struct ColumnInfo { /* private fields */ }
Expand description
Column information in a select statement
Examples
Print column information of emp
table.
let conn = Connection::connect("scott", "tiger", "")?;
let mut stmt = conn.statement("select * from emp").build()?;
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)
Implementations§
source§impl ColumnInfo
impl ColumnInfo
sourcepub fn oracle_type(&self) -> &OracleType
pub fn oracle_type(&self) -> &OracleType
Gets Oracle type
Trait Implementations§
source§impl Clone for ColumnInfo
impl Clone for ColumnInfo
source§fn clone(&self) -> ColumnInfo
fn clone(&self) -> ColumnInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more