You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by harinder nandyala <ha...@hotmail.com> on 2006/02/20 22:38:17 UTC

Similar problem with the same set up....may be there is some solution already..

Hello,

Many thanks for prompt response. That was an easy solution and it worked. I 
am seeing one more problem with the same setup (i.e. DB2 driver type-2). 
When I try to add one order from petstore sample:

*****************************
"A reference to column "ITEMID" is ambigous. SQLSTATE=42702"
The error occured in com/ibatis/jpetstore/sqlmapdao/sql/Item.xml
Check the getItem - InlineParameterMap
Check the statemnent (Query Failed"
**********************************

Probably you may know the answer. I am trying to debug, but if there is 
ready made answer it saves a lot.

"The more you strive for humanity, the more civilized you become" -ASHA

Harinder Nandyala
http://www.ashakiran.org



Re: Similar problem with the same set up....may be there is some solution already..

Posted by "Albert L. Sapp" <as...@uiuc.edu>.
Jeff Butler wrote:

> This error means that a column in the select list is in two or more of 
> the joined tables.  You must qualify the column name with the table 
> (or alias) in the select list.
>  
> It looks to me like the "getItem" query is probably the offending 
> one.  Simple solution - put "i." in front of the itemid like this:
>  
> SELECT
>   I.ITEMID
>   ...
>  
> There may be more of these, you'll have to work them through.  I would 
> consider this a bug in JPetStore (hsqldb must be very forgiving - my 
> guess is that this would fail on most databases). It would be good of 
> you to open a JIRA ticket with the details so we don't forget to make 
> a change.
>  
> Jeff Butler
>
>
>  
> On 2/20/06, *harinder nandyala* <harindern@hotmail.com 
> <ma...@hotmail.com>> wrote:
>
>     Hello,
>
>     Many thanks for prompt response. That was an easy solution and it
>     worked. I
>     am seeing one more problem with the same setup ( i.e. DB2 driver
>     type-2).
>     When I try to add one order from petstore sample:
>
>     *****************************
>     "A reference to column "ITEMID" is ambigous. SQLSTATE=42702"
>     The error occured in com/ibatis/jpetstore/sqlmapdao/sql/Item.xml
>     Check the getItem - InlineParameterMap
>     Check the statemnent (Query Failed"
>     **********************************
>
>     Probably you may know the answer. I am trying to debug, but if
>     there is
>     ready made answer it saves a lot.
>
>     "The more you strive for humanity, the more civilized you become"
>     -ASHA
>
>     Harinder Nandyala
>     http://www.ashakiran.org
>
>
>
This same thing happened when run against a Oracle database.  Doing what 
Jeff suggests fixed it.

Al


Re: Similar problem with the same set up....may be there is some solution already..

Posted by Jeff Butler <je...@gmail.com>.
This error means that a column in the select list is in two or more of the
joined tables.  You must qualify the column name with the table (or alias)
in the select list.

It looks to me like the "getItem" query is probably the offending one.
Simple solution - put "i." in front of the itemid like this:

SELECT
  I.ITEMID
  ...

There may be more of these, you'll have to work them through.  I would
consider this a bug in JPetStore (hsqldb must be very forgiving - my guess
is that this would fail on most databases). It would be good of you to open
a JIRA ticket with the details so we don't forget to make a change.

Jeff Butler



On 2/20/06, harinder nandyala <ha...@hotmail.com> wrote:
>
> Hello,
>
> Many thanks for prompt response. That was an easy solution and it worked.
> I
> am seeing one more problem with the same setup (i.e. DB2 driver type-2).
> When I try to add one order from petstore sample:
>
> *****************************
> "A reference to column "ITEMID" is ambigous. SQLSTATE=42702"
> The error occured in com/ibatis/jpetstore/sqlmapdao/sql/Item.xml
> Check the getItem - InlineParameterMap
> Check the statemnent (Query Failed"
> **********************************
>
> Probably you may know the answer. I am trying to debug, but if there is
> ready made answer it saves a lot.
>
> "The more you strive for humanity, the more civilized you become" -ASHA
>
> Harinder Nandyala
> http://www.ashakiran.org
>
>
>