You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org> on 2005/05/06 08:13:10 UTC
[jira] Created: (IBATISNET-57) MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
------------------------------------------------------------------
Key: IBATISNET-57
URL: http://issues.apache.org/jira/browse/IBATISNET-57
Project: iBatis for .NET
Type: Task
Versions: DataMapper 1.1
Environment: Oracle 9i with MS OracleClient 1.0.5 provider
Reporter: Roberto Rabe
Priority: Minor
The NUnit Oracle.StatementTest.TestUpdateCategoryWithExtendParameterMap() throws OracleException Invalid number.
The failing NUnit update statement is:
<update id="UpdateCategoryViaParameterMap" parameterMap="UpdateParam">
update Categories set
Category_Name = ?,
Category_Guid = ?
where
Category_Id = ?
</update>
The reason is that the parameter order is not correct in the command text:
"update Categories set Category_Name = :Id, Category_Guid = :Name where Category_Id = :GuidString"
The MS OracleClient provider works better using an extended parameter map on insert instead of update since the order of the properties is important.
A work-around is to use a specific parameterMap for the UPDATE or use a parameterClass instead of an extended parameterMap.
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (IBATISNET-57) MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-57?page=all ]
Roberto Rabe closed IBATISNET-57:
---------------------------------
Closing issue.
> MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
> ------------------------------------------------------------------
>
> Key: IBATISNET-57
> URL: http://issues.apache.org/jira/browse/IBATISNET-57
> Project: iBatis for .NET
> Type: Task
> Versions: DataMapper 1.1
> Environment: Oracle 9i with MS OracleClient 1.0.5 provider
> Reporter: Roberto Rabe
> Assignee: Roberto Rabe
> Priority: Minor
>
> The NUnit Oracle.StatementTest.TestUpdateCategoryWithExtendParameterMap() throws OracleException Invalid number.
> The failing NUnit update statement is:
> <update id="UpdateCategoryViaParameterMap" parameterMap="UpdateParam">
> update Categories set
> Category_Name = ?,
> Category_Guid = ?
> where
> Category_Id = ?
> </update>
> The reason is that the parameter order is not correct in the command text:
> "update Categories set Category_Name = :Id, Category_Guid = :Name where Category_Id = :GuidString"
>
> The MS OracleClient provider works better using an extended parameter map on insert instead of update since the order of the properties is important.
>
> A work-around is to use a specific parameterMap for the UPDATE or use a parameterClass instead of an extended parameterMap.
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (IBATISNET-57) MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-57?page=all ]
Roberto Rabe resolved IBATISNET-57:
-----------------------------------
Resolution: Won't Fix
In the MSSQL and MySQL "TestUpdateCategoryWithExtendParameterMap NUnit test, an IDENTITY/AUTOGENERATE Id is generated after the INSERT statement as a "post" selectKey. Therefore, the Id property is not needed as a parameter in the base "insert" parameterMap for those databases.
However, unlike MSSQL and MySQL, we need to have Id as a property in the base parameterMap for Oracle since the test uses a "pre" selectKey sequence that is used on insert into Id property parameter.
<parameterMap id="InsertParam">
<parameter property="Id" column="Category_Id" dbType="Int32" />
<parameter property="Name" column="Category_Name" dbType="VarChar2" size="32"/>
<parameter property="GuidString" column="Category_Guid" dbType="VarChar2" size="36"/>
</parameterMap>
<insert id="InsertCategoryViaParameterMap" parameterMap="InsertParam" resultClass="int">
<selectKey property="Id" type="pre" resultClass="int">
select s_categories.nextval as value from dual
</selectKey>
insert into Categories
(Category_Id, Category_Name, Category_Guid)
values
(?,?,?)
</insert>
Unfortunately, since the Id property is defined in the parameterMap for an INSERT statement, we cannot extend this parameterMap for an UPDATE statement. The Id property is already positioned as the first parameter in the parameterMap when it needs to be the last parameter in an UPDATE statement. We need a specific parameterMap for the "update" parameterMap to extend that does not have the Id parameter already defined as seen with the MSSQL and MySQL tests.
<parameterMap id="InsertParamWithoutId">
<parameter property="Name" column="Category_Name" dbType="VarChar2" size="32"/>
<parameter property="GuidString" column="Category_Guid" dbType="VarChar2" size="36"/>
</parameterMap>
<parameterMap id="UpdateParam" extends="InsertParamWithoutId">
<parameter property="Id" column="Category_Id" dbType="Int32"/>
</parameterMap>
> MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
> ------------------------------------------------------------------
>
> Key: IBATISNET-57
> URL: http://issues.apache.org/jira/browse/IBATISNET-57
> Project: iBatis for .NET
> Type: Task
> Versions: DataMapper 1.1
> Environment: Oracle 9i with MS OracleClient 1.0.5 provider
> Reporter: Roberto Rabe
> Assignee: Roberto Rabe
> Priority: Minor
>
> The NUnit Oracle.StatementTest.TestUpdateCategoryWithExtendParameterMap() throws OracleException Invalid number.
> The failing NUnit update statement is:
> <update id="UpdateCategoryViaParameterMap" parameterMap="UpdateParam">
> update Categories set
> Category_Name = ?,
> Category_Guid = ?
> where
> Category_Id = ?
> </update>
> The reason is that the parameter order is not correct in the command text:
> "update Categories set Category_Name = :Id, Category_Guid = :Name where Category_Id = :GuidString"
>
> The MS OracleClient provider works better using an extended parameter map on insert instead of update since the order of the properties is important.
>
> A work-around is to use a specific parameterMap for the UPDATE or use a parameterClass instead of an extended parameterMap.
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Assigned: (IBATISNET-57) MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
Posted by "Gilles Bayon (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-57?page=all ]
Gilles Bayon reassigned IBATISNET-57:
-------------------------------------
Assign To: Roberto Rabe
> MS OracleClient 1.0.5 Update Statement with Extended Parameter Map
> ------------------------------------------------------------------
>
> Key: IBATISNET-57
> URL: http://issues.apache.org/jira/browse/IBATISNET-57
> Project: iBatis for .NET
> Type: Task
> Versions: DataMapper 1.1
> Environment: Oracle 9i with MS OracleClient 1.0.5 provider
> Reporter: Roberto Rabe
> Assignee: Roberto Rabe
> Priority: Minor
>
> The NUnit Oracle.StatementTest.TestUpdateCategoryWithExtendParameterMap() throws OracleException Invalid number.
> The failing NUnit update statement is:
> <update id="UpdateCategoryViaParameterMap" parameterMap="UpdateParam">
> update Categories set
> Category_Name = ?,
> Category_Guid = ?
> where
> Category_Id = ?
> </update>
> The reason is that the parameter order is not correct in the command text:
> "update Categories set Category_Name = :Id, Category_Guid = :Name where Category_Id = :GuidString"
>
> The MS OracleClient provider works better using an extended parameter map on insert instead of update since the order of the properties is important.
>
> A work-around is to use a specific parameterMap for the UPDATE or use a parameterClass instead of an extended parameterMap.
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira