summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@oracle.com>2010-08-31 13:42:47 +0200
committerOcke Janssen [oj] <Ocke.Janssen@oracle.com>2010-08-31 13:42:47 +0200
commite2526f4b238517d1c80abee19b1b819ed95affa7 (patch)
tree24673d19c9ed31223baa59110e3ad3b1cb78e971
parent8d2c8b1c670fc900e1387ae9c4ddbe50418596a3 (diff)
dba33i: #i114173# fix name to select from and field name of auto incremtn column
-rw-r--r--dbaccess/source/core/api/KeySet.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index eb1699f33..3cea96623 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -809,10 +809,12 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString
for (;aAutoIter != aAutoEnd; ++aAutoIter)
{
// we will only fetch values which are keycolumns
- if ( m_pKeyColumnNames->find(*aAutoIter) != aEnd )
+ SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter);
+ if ( aFind != aEnd )
{
sMaxStmt += sMax;
- sMaxStmt += ::dbtools::quoteName( sQuote,*aAutoIter);
+ sMaxStmt += ::dbtools::quoteName( sQuote,aFind->second.sRealName
+);
sMaxStmt += sMaxEnd;
}
}
@@ -823,7 +825,9 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString
::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT ");
sStmt += sMaxStmt;
sStmt += ::rtl::OUString::createFromAscii("FROM ");
- sStmt += m_aSelectComposedTableName;
+ ::rtl::OUString sCatalog,sSchema,sTable;
+ ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
+ sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable );
try
{
// now fetch the autoincrement values