Tag: cws_src680_dba201 User: oj Date: 05/04/25 04:16:36 Modified: /dba/connectivity/source/drivers/hsqldb/ HTable.cxx /dba/connectivity/source/inc/hsqldb/ HTable.hxx
Log: #i47143# change syntax of renaming tables 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&r2=1.2.8.1 Delta lines: +41 -2 -------------------- --- HTable.cxx 6 Apr 2005 10:35:40 -0000 1.2 +++ HTable.cxx 25 Apr 2005 11:16:33 -0000 1.2.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: HTable.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.8.1 $ * - * last change: $Author: hr $ $Date: 2005/04/06 10:35:40 $ + * last change: $Author: oj $ $Date: 2005/04/25 11:16:33 $ * * 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); +} Directory: /dba/connectivity/source/inc/hsqldb/ =============================================== File [changed]: HTable.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/hsqldb/HTable.hxx?r1=1.2&r2=1.2.8.1 Delta lines: +6 -2 ------------------- --- HTable.hxx 6 Apr 2005 10:38:35 -0000 1.2 +++ HTable.hxx 25 Apr 2005 11:16:33 -0000 1.2.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: HTable.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.8.1 $ * - * last change: $Author: hr $ $Date: 2005/04/06 10:38:35 $ + * last change: $Author: oj $ $Date: 2005/04/25 11:16:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,6 +144,10 @@ // XAlterTable virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + // XRename + virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); + /** returns the ALTER TABLE XXX COLUMN statement */ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
