# Obtaining column type in OCI8

**URL:** <https://www.ruby-forum.com/t/obtaining-column-type-in-oci8/119555>\
**Category:** Ruby\
**Created:** [November 7, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/obtaining-column-type-in-oci8/119555 "2007-11-07T22:57:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean\_n](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sean\_n](https://www.ruby-forum.com/u/sean_n)\
**Post date:** [November 7, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/obtaining-column-type-in-oci8/119555/1 "2007-11-07T22:57:36Z")

</div>

Using the OCI8 module, how does one obtain the type of a column in a  
table? For example, how do we know if a column is a VARCHAR or a  
NUMBER?

---

<div class="post-metadata">

**Author:** ![sean\_n](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sean\_n](https://www.ruby-forum.com/u/sean_n)\
**Post date:** [November 11, 2007, 4:34am UTC](https://www.ruby-forum.com/t/obtaining-column-type-in-oci8/119555/2 "2007-11-11T04:34:49Z")

</div>

Hi,

On 11/8/07, Sean N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Using the OCI8 module, how does one obtain the type of a column in a  
> table? For example, how do we know if a column is a VARCHAR or a NUMBER?

Column types of an existing table, or of a query?  
For the former, you can get the column types by querying  
USER\_TAB\_COLUMNS data dictionary.  
For the latter, you have no way now. It will be supported at the next  
release.  
[http://rubyforge.org/forum/forum.php?thread\_id=17986&forum\_id=1078](http://rubyforge.org/forum/forum.php?thread_id=17986&forum_id=1078)
