Tag: cws_src680_dba20blocker User: fs Date: 05/06/23 06:30:22 Modified: /dba/connectivity/source/drivers/hsqldb/ HTable.cxx
Log: copying fix for #i47143# 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.2.34.1&r2=1.2.34.2 Delta lines: +41 -2 -------------------- --- HTable.cxx 23 Jun 2005 12:28:47 -0000 1.2.34.1 +++ HTable.cxx 23 Jun 2005 13:30:19 -0000 1.2.34.2 @@ -2,9 +2,9 @@ * * $RCSfile: HTable.cxx,v $ * - * $Revision: 1.2.34.1 $ + * $Revision: 1.2.34.2 $ * - * last change: $Author: fs $ $Date: 2005/06/23 12:28:47 $ + * last change: $Author: fs $ $Date: 2005/06/23 13:30:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -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]
