Tag: cws_src680_dba30 User: fs Date: 06/05/08 04:26:52 Modified: /dba/dbaccess/source/ui/misc/ TableCopyHelper.cxx
Log: RESYNC: (1.5-1.6); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: TableCopyHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/TableCopyHelper.cxx?r1=1.4.16.1&r2=1.4.16.2 Delta lines: +5 -43 -------------------- --- TableCopyHelper.cxx 12 Dec 2005 08:03:13 -0000 1.4.16.1 +++ TableCopyHelper.cxx 8 May 2006 11:26:50 -0000 1.4.16.2 @@ -211,49 +211,10 @@ for(sal_Int32 k=1;k <= nCount;++k) aColumnTypes.push_back(xMeta->getColumnType(k)); - // create sql string and set column types - Reference<XNameAccess> xNameAccess = xColsSup->getColumns(); - Sequence< ::rtl::OUString> aSeq = xNameAccess->getElementNames(); - if ( aSeq.getLength() == 0 ) - { - return; - } - const ::rtl::OUString* pBegin = aSeq.getConstArray(); - const ::rtl::OUString* pEnd = pBegin + aSeq.getLength(); - ::std::vector< ::rtl::OUString> aInsertList; - aInsertList.resize(aSeq.getLength()+1); - sal_Int32 i = 0; - for(sal_uInt32 j=0; j < aInsertList.size() ;++i,++j) - { - ODatabaseExport::TPositions::const_iterator aFind = ::std::find_if(_rvColumns.begin(),_rvColumns.end(), - ::std::compose1(::std::bind2nd(::std::equal_to<sal_Int32>(),i+1),::std::select2nd<ODatabaseExport::TPositions::value_type>())); - if ( _rvColumns.end() != aFind && aFind->second != CONTAINER_ENTRY_NOTFOUND && aFind->first != CONTAINER_ENTRY_NOTFOUND ) - { - aInsertList[aFind->first] = ::dbtools::quoteName( aQuote,*(pBegin+i)); - } - } - - i = 1; - // create the sql string - for (::std::vector< ::rtl::OUString>::iterator aInsertIter = aInsertList.begin(); aInsertIter != aInsertList.end(); ++aInsertIter) - { - if ( aInsertIter->getLength() ) - { - aSql += *aInsertIter; - aSql += aComma; - aValues += aPara; - } - } - - aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"))); - aValues = aValues.replaceAt(aValues.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"))); - - aSql += aValues; // now create,fill and execute the prepared statement - Reference< XPreparedStatement > xPrep(_xMetaData->getConnection()->prepareStatement(aSql)); + Reference< XPreparedStatement > xPrep(ODatabaseExport::createPreparedStatment(_xMetaData,_xDestTable,_rvColumns)); Reference< XParameters > xParameter(xPrep,UNO_QUERY); - sal_Int32 nRowCount = 0; const Any* pSelBegin = _aSelection.getConstArray(); const Any* pSelEnd = pSelBegin + _aSelection.getLength(); @@ -853,6 +814,7 @@ else m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString::createFromAscii("S1000") ,0,Any())); } +// ----------------------------------------------------------------------------- //........................................................................ } // namespace dbaui //........................................................................ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
