logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

[jira] Commented: (DERBY-147) ERROR 42X79 not consistant ? - same column na: msg#00337

apache.db.derby.devel

Subject: [jira] Commented: (DERBY-147) ERROR 42X79 not consistant ? - same column name specified twice

[
http://issues.apache.org/jira/browse/DERBY-147?page=comments#action_59875 ]

Bernd Ruehlicke commented on DERBY-147:
---------------------------------------

Ok I made the changes and build Derby - and tested it - seams to work.

We may consider to make this change permanent.

Any reason for this error log was added ?

Here the code snipled (need to chnage getOrderBy(String, String) and
getOrderBy(String, String, int)

...
if (columnName.equals( resultColumn.getName()) )
{
if (retVal == null)
{
retVal = resultColumn;
}
// DERBY-147 else if (index < size -
orderBySelect)
// DERBY-147 {
// DERBY-147 throw
StandardException.newException(SQLState.LANG_DUPLICATE_COLUMN_FOR_ORDER_BY,
columnName);
// DERBY-147 }
else
{// remove the column due to pullup of orderby
item
removeElement(resultColumn);
decOrderBySelect();
break;
}
}
...


By the way - if already at the code - and since the code is more or less the
same would be handy to refactor the getOrderBy(String, String) to

getOrderBy(String, String)
{
return getOrderBy(String, String, null);
}

and handle "null" in the String, String, int method.


B-)

> ERROR 42X79 not consistant ? - same column name specified twice
> ---------------------------------------------------------------
>
> Key: DERBY-147
> URL: http://issues.apache.org/jira/browse/DERBY-147
> Project: Derby
> Type: Bug
> Reporter: Bernd Ruehlicke

>
> This happens from JDBC or ij. Here the output form ij>
> ij version 10.0
> CONNECTION0* - jdbc:derby:phsDB
> * = current connection
> ij> select a1.XXX_foreign, a1.native, a1.kind, a1.XXX_foreign FROM
> slg_name_lookup a1 ORDER BY a1.XXX_foreign;
> ERROR 42X79: Column name 'XXX_FOREIGN' appears more than once in the result
> of the query expression.
> But when removing the ORDER BY and keeping the 2 same column names it works
> ij> select a1.XXX_foreign, a1.native, a1.kind, a1.XXX_foreign FROM
> slg_name_lookup a1;
> XXX_FOREIGN
> |NATIVE
> |KIND |XXX_FOREIGN
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 0 rows selected
> ij>
> So - it seams to be OK to specify the same column twice - as long as you do
> not add the ORDER BY clause.
> I woul dof course like that the system allows this - but at leats it should
> be consistant and either allow both or none of the two queries above.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira




<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo