summaryrefslogtreecommitdiff
path: root/dbaccess
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
commit368fcc28b151d4c5428e67e15a1e60f64a88d832 (patch)
treecab8a87dd497ccf6110de494ffc125351d3e1c8e /dbaccess
parent2d1d598eabb3b131821f33366148be4ee6b730cc (diff)
dba33i: #i114173# fix name to select from and field name of auto incremtn column
Diffstat (limited to 'dbaccess')
-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 992c748aad2e..3d4f66ff8830 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