User: obo Date: 05/07/08 03:26:10 Modified: /dba/connectivity/source/drivers/hsqldb/ HTable.cxx
Log: INTEGRATION: CWS dba20blocker (1.2.34); FILE MERGED 2005/06/23 13:30:19 fs 1.2.34.2: copying fix for #i47143# into this CWS 2005/06/23 12:28:47 fs 1.2.34.1: copying fix for #i48480# into this CWS 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.4&r2=1.5 Delta lines: +43 -4 -------------------- --- HTable.cxx 5 Jul 2005 07:51:12 -0000 1.4 +++ HTable.cxx 8 Jul 2005 10:26:08 -0000 1.5 @@ -348,7 +348,7 @@ sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN ")); const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( ); - OColumn* pColumn = new OColumn(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)); @@ -408,6 +408,45 @@ } } // ----------------------------------------------------------------------------- +// 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]
