Tag: cws_src680_dba201b User: oj Date: 05/07/11 00:11:59 Modified: /dba/connectivity/source/drivers/hsqldb/ HTable.cxx
Log: RESYNC: (1.2-1.5); FILE MERGED File Changes: Directory: /dba/connectivity/source/drivers/hsqldb/ =================================================== File [changed]: HTable.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/hsqldb/HTable.cxx?r1=1.2.38.1&r2=1.2.38.2 Delta lines: +44 -4 -------------------- --- HTable.cxx 5 Jul 2005 07:48:58 -0000 1.2.38.1 +++ HTable.cxx 11 Jul 2005 07:11:55 -0000 1.2.38.2 @@ -348,7 +348,7 @@ sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN ")); const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); - OColumn* pColumn = new OHSQLColumn(sal_True); + OHSQLColumn* pColumn = new OHSQLColumn(sal_True); Reference<XPropertySet> xProp = pColumn; ::comphelper::copyProperties(_xDescriptor,xProp); xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType)); @@ -428,6 +428,46 @@ return Sequence< Type >(pTypes, aOwnTypes.size()); } return OTableHelper::getTypes(); +} +// ------------------------------------------------------------------------- +// XRename +void SAL_CALL OHSQLTable::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException) +{ + ::osl::MutexGuard aGuard(m_aMutex); + checkDisposed( +#ifdef GCC + ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed +#else + rBHelper.bDisposed +#endif + ); + + if(!isNew()) + { + ::rtl::OUString sSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER ")); + if ( m_Type == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")) ) + sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" VIEW ")); + else + sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TABLE ")); + + ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); + + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + + ::rtl::OUString sComposedName; + ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sComposedName,sal_True,::dbtools::eInDataManipulation); + sSql += sComposedName + + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" RENAME TO ")); + ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInDataManipulation); + sSql += sComposedName; + + executeStatement(sSql); + + ::connectivity::OTable_TYPEDEF::rename(newName); + } + else + ::dbtools::qualifiedNameComponents(getMetaData(),newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInTableDefinitions); } // ------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
