Hi,

 

I want to return a value from a stored Procedure with Ibatis.  I did all the steps indicated in the documentation but I can’t get the value.  Can you please send me a sample code to do this.  I’m including my code for your review.

 

<parameterMap id="NewsInsert-Params">

      <parameter property="NewsId" column="OUT_NEWS_ID" direction="Output" dbType="Numeric"/>

      <parameter property="Status" column="STATUS" />

      <parameter property="EmpId" column="EMP_ID" />

      <parameter property="DeptCode" column="DEPT_CODE" />

      <parameter property="NewsDate" column="NEWS_DATE" />

      <parameter property="Description" column="DESCRIPTION" />

      <parameter property="NewsText" column="NEWS_TEXT" />

      <parameter property="EffectiveFrom" column="EFFECTIVE_FROM" />

      <parameter property="EffectiveTo" column="EFFECTIVE_TO" />

      <parameter property="TimeFrom" column="TIME_FROM" />

      <parameter property="TimeTo" column="TIME_TO" />

      <parameter property="Type" column="TYPE" />

      <parameter property="DivisionCode" column="DIVISION_CODE" />

      <parameter property="ModificationId" column="MODIFICATION_ID" />

      <parameter property="ModificationName" column="MODIFICATION_NAME" />

      <parameter property="TrnCode" column="TRN_CODE" />

      <parameter property="NewsAuditor.SigAction" resultMapping="NewsMap.AuditSignature.SigAction" />

     

<parameter property="NewsAuditor.SigMeaning" resultMapping="NewsMap.AuditSignature.SigMeaning" />

                  <parameter property="NewsAuditor.KeyId" resultMapping="NewsMap.AuditSignature.KeyId" />

                  <parameter property="NewsAuditor.KeyUserId" resultMapping="NewsMap.AuditSignature.KEYUSERID" />

</parameterMap>

 

<procedure id="InsertNews" parameterMap="NewsInsert-Params" resultClass="News">

SP_NEWS_INSERT

</procedure>

 

‘This is a Method in my Class NewsMap, it is supposed to return an object representing the News entity with the NewsId filled

Public Overloads Function Insert(ByVal objNews As Domain.Maintenance.News) As Domain.Maintenance.News Implements Interfaces.Maintenance.INews.Insert

    Return ExecuteQueryForObject("InsertNews", objNews)

End Function

 

‘Here is the implementation but does not return nothing

objNewsDomain = objNewsMap.Insert(CreateObject("I"))

 

I would appreciate any help you could give me.

 

Regards,

Gladys 

Reply via email to