Re: Getting ttable's columns info

From: Michael Austin <maustin_at_firstdbasource.com>
Date: Sat, 19 Jul 2008 21:04:07 -0500
Message-ID: <M0xgk.15840$uE5.6098@flpi144.ffdc.sbc.com>


Damu wrote:
> I'm writing an application using C++ and OCCI driver.
>
>
> try
> {
> MetaData tabInfo = conn->getMetaData( tab_name,
> MetaData::PTYPE_TABLE );
>
> if(tabInfo.getInt(tabInfo.ATTR_PTYPE) != MetaData::PTYPE_TABLE)
> {
> error_msg = tab_name + ". Invalid table.";
> return false;
> }
>
> vector<MetaData> colsInfo =
> tabInfo.getVector( MetaData::ATTR_LIST_COLUMNS );
> for( unsigned int i=0; i<colsInfo.size(); i++ )
> {
> cout << colsInfo[i].getString( MetaData::ATTR_NAME ) << endl;
> cout << colsInfo[i].getInt( MetaData::ATTR_PRECISION ) << endl;
> cout << colsInfo[i].getInt( MetaData::ATTR_SCALE ) << endl;
> cout << colsInfo[i].getString( MetaData::ATTR_TYPE_NAME ) << endl;
> cout << colsInfo[i].getBoolean( MetaData::ATTR_IS_NULL ) << endl;
> }
> }
> catch( SQLException & e )
> {
> retval = false;
> string str = e.getMessage();
> }
>
> I can't get the type table's column

What does getMetaData() do? does it query a table or select from the table and parse to get the information.

Can you query the V$ views or DBA_* views to parse the information you are needing?? Received on Sat Jul 19 2008 - 21:04:07 CDT

Original text of this message