1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 #include <connectivity/dbtools.hxx>
15 using namespace ::connectivity
;
16 using namespace ::connectivity::firebird
;
18 using namespace ::dbtools
;
19 using namespace ::osl
;
21 using namespace ::com::sun::star
;
22 using namespace ::com::sun::star::beans
;
23 using namespace ::com::sun::star::sdbc
;
24 using namespace ::com::sun::star::uno
;
26 Keys::Keys(Table
* pTable
, Mutex
& rMutex
, const ::std::vector
< OUString
>& rNames
):
34 //----- XDrop ----------------------------------------------------------------
35 void Keys::dropObject(sal_Int32 nPosition
, const OUString
& sName
)
37 if (m_pTable
->isNew())
40 uno::Reference
<XPropertySet
> xKey(getObject(nPosition
), UNO_QUERY
);
44 const OUString sQuote
= m_pTable
->getConnection()->getMetaData()
45 ->getIdentifierQuoteString();
47 OUString
sSql("ALTER TABLE " + quoteName(sQuote
, m_pTable
->getName())
48 + " DROP CONSTRAINT " + quoteName(sQuote
, sName
));
50 m_pTable
->getConnection()->createStatement()->execute(sSql
);
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */