summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 09:33:45 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 09:33:45 +0000
commitb12bb1edc305c7df0651b19ebfc77b5491bcb9cb (patch)
treec9db6c62b99459fd98089f96401154fc371b38bc /wizards
parent2d339c2072584b34fe898a984e0c43443ceb1f16 (diff)
INTEGRATION: CWS dba31a (1.12.10); FILE MERGED
2008/07/02 12:06:10 fs 1.12.10.1: copying following changes from CWS dba30f to CWS dba31a: 2008/07/01 09:41:34 lla 1.12.2.1: #i82743# problem with 'Title' as DB Entry name
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/db/SQLQueryComposer.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
index 18ac74a3bb83..53d9c677e7c5 100644
--- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
+++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SQLQueryComposer.java,v $
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
* This file is part of OpenOffice.org.
*
@@ -94,28 +94,40 @@ public class SQLQueryComposer {
return true;
}
- public void appendSelectClause(boolean _baddAliasFieldNames) throws SQLException {
+ public void appendSelectClause(boolean _baddAliasFieldNames) throws SQLException
+ {
String sSelectBaseClause = "SELECT ";
selectclause = sSelectBaseClause;
- for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++) {
- if (addtoSelectClause(CurDBMetaData.FieldColumns[i].DisplayFieldName)) {
+ for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++)
+ {
+ if (addtoSelectClause(CurDBMetaData.FieldColumns[i].DisplayFieldName))
+ {
int iAggregate = CurDBMetaData.getAggregateIndex(CurDBMetaData.FieldColumns[i].DisplayFieldName);
- if (iAggregate > -1) {
+ if (iAggregate > -1)
+ {
selectclause += CurDBMetaData.AggregateFieldNames[iAggregate][1] + "(" + getComposedAliasFieldName(CurDBMetaData.AggregateFieldNames[iAggregate][0]) + ")";
if (_baddAliasFieldNames)
+ {
selectclause += getAliasFieldNameClause(CurDBMetaData.AggregateFieldNames[iAggregate][0]);
- } else {
+ }
+ }
+ else
+ {
selectclause += getComposedAliasFieldName(CurDBMetaData.FieldColumns[i].DisplayFieldName);
if (_baddAliasFieldNames)
+ {
selectclause += getAliasFieldNameClause(CurDBMetaData.FieldColumns[i].DisplayFieldName);
}
+ }
selectclause += ", ";
}
}
- if (selectclause.equals(sSelectBaseClause)){
+ if (selectclause.equals(sSelectBaseClause))
+ {
selectclause = selectclause.substring(0, selectclause.length() - 1);
}
- else{
+ else
+ {
selectclause = selectclause.substring(0, selectclause.length() - 2);
}
}