You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Rainer Döbele (JIRA)" <em...@incubator.apache.org> on 2013/02/04 15:12:14 UTC
[jira] [Closed] (EMPIREDB-75) DBCommand should allow me to select
duplicate columns
[ https://issues.apache.org/jira/browse/EMPIREDB-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rainer Döbele closed EMPIREDB-75.
---------------------------------
Cleanup of unclosed issues.
> DBCommand should allow me to select duplicate columns
> -----------------------------------------------------
>
> Key: EMPIREDB-75
> URL: https://issues.apache.org/jira/browse/EMPIREDB-75
> Project: Empire-DB
> Issue Type: Bug
> Components: Core
> Affects Versions: empire-db-2.0.5-incubating
> Environment: Win32, JDK1.6.0_15
> Reporter: Greg Reiser
> Assignee: Rainer Döbele
>
> Allowing the option to (explicitly) select a duplicate column in DBCommand would be helpful for a UNION type of statement. Here is the scenario: I have enterprise educators that are able to work within all colleges in a university while I have others that can only work in specific colleges (specialized). Also, each educator can have an enterprise id and/or a facility-specific ID. I need to be able to query the possible educators for a specific college. Here is my SQL:
> SELECT t70.EDUCATOR_CODE, t69.EDUCATOR_ID, t69.EDUCATOR_SID
> FROM EDUCATOR t69, EDUCATOR_FACILITY t70
> WHERE t69.EDUCATOR_SID=t70.EDUCATOR_SID AND t69.STATUS=1 AND t70.FACILITY_SID=355
> UNION
> SELECT t69.EDUCATOR_ID, t69.EDUCATOR_ID, t69.EDUCATOR_SID
> FROM EDUCATOR t69
> WHERE t69.FACILITY_MAP_CODE=1 AND t69.STATUS=1
> An overloaded select() method on DBCommand was sufficient in my dev environment:
> public void select(DBColumnExpr expr, boolean allowDuplicateColumns)
> { // Select this column
> if (select == null)
> select = new ArrayList<DBColumnExpr>();
> if (expr != null && allowDuplicateColumns ? true : (select.contains(expr) == false))
> select.add(expr);
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira