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 "Rao, Satish" <sa...@fmr.com> on 2005/07/13 17:49:26 UTC
Getting UncategorizedSQLException
I get an UncategorizedSQLException when I execute the 'listRunDetails'
select statement shown below. The query is a join between two tables. Am
I doing something wrong here?
<resultMap id="list-rundetail-result" class="com.xxx.xxx.Order">
<result property="orderId" column="R.ORD_ID"/>
<result property="participantId" column="PART_ID"/>
<result property="clientId" column="CLNT_ID_N"/>
<result property="plan" column="PLAN_N"/>
<result property="channel.channelType"
column="CHAN_TYPE_C"/>
<result property="channel.email" column="EMAIL_ADDR_X"/>
<result property="channel.line1Address"
column="LINE_1_AD_X"/>
</resultMap>
<select id="listRunDetails" resultMap="list-rundetail-result"
cacheModel="rundetail-cache">
SELECT
R.ORD_ID,
PART_ID,
CLNT_ID_N,
CHAN_TYPE_C,
EMAIL_ADDR_X,
LINE_1_AD_X,
FROM
TABLE1 R, TABLE2 O
WHERE
R.ORD_ID = O.ORD_ID
AND
R.RUN_ID LIKE #runId#
<isNotNull prepend="AND" property="participantId">
R.PART_ID LIKE #participantId#
</isNotNull>
<isGreaterThan prepend="AND" property="client"
compareValue="0">
R.CLNT_ID_N = #client#
</isGreaterThan>
</select>
com.xxx.xxx.Order contains Channel object.
Re: Getting UncategorizedSQLException
Posted by Zarar Siddiqi <za...@utoronto.ca>.
Getting UncategorizedSQLExceptionTry changing
SELECT R.ORD_ID
to
SELECT R.ORD_ID as ORD_ID and see if it works.
----- Original Message -----
From: Rao, Satish
To: user-java@ibatis.apache.org
Sent: Wednesday, July 13, 2005 11:49 AM
Subject: Getting UncategorizedSQLException
I get an UncategorizedSQLException when I execute the 'listRunDetails' select statement shown below. The query is a join between two tables. Am I doing something wrong here?
<resultMap id="list-rundetail-result" class="com.xxx.xxx.Order">
<result property="orderId" column="R.ORD_ID"/>
<result property="participantId" column="PART_ID"/>
<result property="clientId" column="CLNT_ID_N"/>
<result property="plan" column="PLAN_N"/>
<result property="channel.channelType" column="CHAN_TYPE_C"/>
<result property="channel.email" column="EMAIL_ADDR_X"/>
<result property="channel.line1Address" column="LINE_1_AD_X"/>
</resultMap>
<select id="listRunDetails" resultMap="list-rundetail-result" cacheModel="rundetail-cache">
SELECT
R.ORD_ID,
PART_ID,
CLNT_ID_N,
CHAN_TYPE_C,
EMAIL_ADDR_X,
LINE_1_AD_X,
FROM
TABLE1 R, TABLE2 O
WHERE
R.ORD_ID = O.ORD_ID
AND
R.RUN_ID LIKE #runId#
<isNotNull prepend="AND" property="participantId">
R.PART_ID LIKE #participantId#
</isNotNull>
<isGreaterThan prepend="AND" property="client" compareValue="0">
R.CLNT_ID_N = #client#
</isGreaterThan>
</select>
com.xxx.xxx.Order contains Channel object.
Re: Getting UncategorizedSQLException
Posted by Zarar Siddiqi <za...@utoronto.ca>.
Getting UncategorizedSQLExceptionYou're using this:
<result property="plan" column="PLAN_N"/>
but not retrieving PLAN_N in your SELECT clause. I don't know if this is the reason for the UncategorizedSQLException but it's a problem otherwise also.
----- Original Message -----
From: Rao, Satish
To: user-java@ibatis.apache.org
Sent: Wednesday, July 13, 2005 11:49 AM
Subject: Getting UncategorizedSQLException
I get an UncategorizedSQLException when I execute the 'listRunDetails' select statement shown below. The query is a join between two tables. Am I doing something wrong here?
<resultMap id="list-rundetail-result" class="com.xxx.xxx.Order">
<result property="orderId" column="R.ORD_ID"/>
<result property="participantId" column="PART_ID"/>
<result property="clientId" column="CLNT_ID_N"/>
<result property="plan" column="PLAN_N"/>
<result property="channel.channelType" column="CHAN_TYPE_C"/>
<result property="channel.email" column="EMAIL_ADDR_X"/>
<result property="channel.line1Address" column="LINE_1_AD_X"/>
</resultMap>
<select id="listRunDetails" resultMap="list-rundetail-result" cacheModel="rundetail-cache">
SELECT
R.ORD_ID,
PART_ID,
CLNT_ID_N,
CHAN_TYPE_C,
EMAIL_ADDR_X,
LINE_1_AD_X,
FROM
TABLE1 R, TABLE2 O
WHERE
R.ORD_ID = O.ORD_ID
AND
R.RUN_ID LIKE #runId#
<isNotNull prepend="AND" property="participantId">
R.PART_ID LIKE #participantId#
</isNotNull>
<isGreaterThan prepend="AND" property="client" compareValue="0">
R.CLNT_ID_N = #client#
</isGreaterThan>
</select>
com.xxx.xxx.Order contains Channel object.
Re: Getting UncategorizedSQLException
Posted by Ron Grabowski <ro...@yahoo.com>.
Does it work if you change the first result node to:
<result property="orderId" column="ORD_ID"/>
or
<result property="orderId" columnIndex="0"/>
--- "Rao, Satish" <sa...@fmr.com> wrote:
>
> I get an UncategorizedSQLException when I execute the
> 'listRunDetails'
> select statement shown below. The query is a join between two tables.
> Am
> I doing something wrong here?
>
> <resultMap id="list-rundetail-result" class="com.xxx.xxx.Order">
> <result property="orderId" column="R.ORD_ID"/>
> <result property="participantId" column="PART_ID"/>
> <result property="clientId" column="CLNT_ID_N"/>
> <result property="plan" column="PLAN_N"/>
> <result property="channel.channelType"
> column="CHAN_TYPE_C"/>
> <result property="channel.email" column="EMAIL_ADDR_X"/>
> <result property="channel.line1Address"
> column="LINE_1_AD_X"/>
> </resultMap>
>
> <select id="listRunDetails" resultMap="list-rundetail-result"
> cacheModel="rundetail-cache">
> SELECT
> R.ORD_ID,
> PART_ID,
> CLNT_ID_N,
> CHAN_TYPE_C,
> EMAIL_ADDR_X,
> LINE_1_AD_X,
> FROM
> TABLE1 R, TABLE2 O
> WHERE
> R.ORD_ID = O.ORD_ID
> AND
> R.RUN_ID LIKE #runId#
> <isNotNull prepend="AND" property="participantId">
> R.PART_ID LIKE #participantId#
> </isNotNull>
> <isGreaterThan prepend="AND" property="client"
> compareValue="0">
> R.CLNT_ID_N = #client#
> </isGreaterThan>
> </select>
>
>
> com.xxx.xxx.Order contains Channel object.
>
>