mybatis stored procedure error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

mybatis stored procedure error

sreekanth.r.vanguru
Hello,

I get this error when I try to invoke stored procedure call in mysql via mybatis.

Caused by: java.sql.SQLException: OUT or INOUT argument 10 for routine RefConnection.create_connection is not a variable or NEW pseudo-variable in BEFORE trigger

here's my mapper file statement

 <insert id = "insertInterfaceMapping" parameterType = "com.sdnctl.sdnf.dal.mybatis.RCTConnectionWrapper" statementType = "CALLABLE">
    {call create_connection(#{toaName,mode = IN,jdbcType=VARCHAR}, #{toaBundleIf, mode = IN,jdbcType=VARCHAR}, #{computeServer, mode=IN,jdbcType=VARCHAR}, #{computeServerIf, mode=IN,jdbcType=VARCHAR}, #{purpose, mode=IN,jdbcType=VARCHAR}, #{configPhase, mode=IN,jdbcType=VARCHAR}, #{status, mode=IN,jdbcType=VARCHAR}, #{lagProfile, mode=IN,jdbcType=VARCHAR}, #{comment, mode=IN,jdbcType=VARCHAR}, #{connectionId, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorCode, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorMsg, mode=OUT, javaType=java.lang.String, jdbcType=VARCHAR})}
 </insert>   

I am filling all the input in RCTConnectionWrapper class and expecting to be also set in the fields of the same class.

I see mysql doesn't like the OUT parameter to be passed this way. It's complaining about argument 10 which is the first OUT argument. Is there any other work around for this?

Sreekanth

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: mybatis stored procedure error

Guy Rouillier-2
I'm not an expert at MySQL, but found this by searching for the error message.  Perhaps you can apply this solution with an inline procedure (anonymous begin-end block).


--
Guy Rouillier

------ Original Message ------
To: "mybatis-user" <[hidden email]>
Sent: 8/13/2018 2:00:01 PM
Subject: mybatis stored procedure error

Hello,

I get this error when I try to invoke stored procedure call in mysql via mybatis.

Caused by: java.sql.SQLException: OUT or INOUT argument 10 for routine RefConnection.create_connection is not a variable or NEW pseudo-variable in BEFORE trigger

here's my mapper file statement

 <insert id = "insertInterfaceMapping" parameterType = "com.sdnctl.sdnf.dal.mybatis.RCTConnectionWrapper" statementType = "CALLABLE">
    {call create_connection(#{toaName,mode = IN,jdbcType=VARCHAR}, #{toaBundleIf, mode = IN,jdbcType=VARCHAR}, #{computeServer, mode=IN,jdbcType=VARCHAR}, #{computeServerIf, mode=IN,jdbcType=VARCHAR}, #{purpose, mode=IN,jdbcType=VARCHAR}, #{configPhase, mode=IN,jdbcType=VARCHAR}, #{status, mode=IN,jdbcType=VARCHAR}, #{lagProfile, mode=IN,jdbcType=VARCHAR}, #{comment, mode=IN,jdbcType=VARCHAR}, #{connectionId, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorCode, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorMsg, mode=OUT, javaType=java.lang.String, jdbcType=VARCHAR})}
 </insert>   

I am filling all the input in RCTConnectionWrapper class and expecting to be also set in the fields of the same class.

I see mysql doesn't like the OUT parameter to be passed this way. It's complaining about argument 10 which is the first OUT argument. Is there any other work around for this?

Sreekanth

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: mybatis stored procedure error

sreekanth.r.vanguru
Yes.. this worked for me. Thanks Guy. Here's what I used.

 <select id = "insertInterfaceMapping" resultMap="RCTConnectionWrapper" parameterType = "RCTConnectionWrapper" >
    {call create_connection(#{toaName,mode = IN,jdbcType=VARCHAR}, #{toaBundleIf, mode = IN,jdbcType=VARCHAR}, #{computeServer, mode=IN,jdbcType=VARCHAR}, #{computeServerIf, mode=IN,jdbcType=VARCHAR}, #{purpose, mode=IN,jdbcType=VARCHAR}, #{configPhase, mode=IN,jdbcType=VARCHAR}, #{status, mode=IN,jdbcType=VARCHAR}, #{lagProfile, mode=IN,jdbcType=VARCHAR}, #{comment, mode=IN,jdbcType=VARCHAR}, @connectionId, @errorCode, @errorMsg);
     select @connectionId as "connectionId", @errorCode as "errorCode", @errorMsg as "errorMsg"}
 </select>

On Tuesday, August 14, 2018 at 12:05:44 AM UTC-4, Guy Rouillier wrote:
I'm not an expert at MySQL, but found this by searching for the error message.  Perhaps you can apply this solution with an inline procedure (anonymous begin-end block).

<a href="https://stackoverflow.com/questions/9751707/mysql-not-a-variable-or-new-pseudo-variable-message" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F9751707%2Fmysql-not-a-variable-or-new-pseudo-variable-message\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxy9KJAyUqezvc-GWgorx90h7xxA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F9751707%2Fmysql-not-a-variable-or-new-pseudo-variable-message\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxy9KJAyUqezvc-GWgorx90h7xxA&#39;;return true;">https://stackoverflow.com/questions/9751707/mysql-not-a-variable-or-new-pseudo-variable-message

--
Guy Rouillier

------ Original Message ------
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="DgqmPwZaAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sreekanth...@...
To: "mybatis-user" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="DgqmPwZaAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@...>
Sent: 8/13/2018 2:00:01 PM
Subject: mybatis stored procedure error

Hello,

I get this error when I try to invoke stored procedure call in mysql via mybatis.

Caused by: java.sql.SQLException: OUT or INOUT argument 10 for routine RefConnection.create_connection is not a variable or NEW pseudo-variable in BEFORE trigger

here's my mapper file statement

 <insert id = "insertInterfaceMapping" parameterType = "com.sdnctl.sdnf.dal.mybatis.RCTConnectionWrapper" statementType = "CALLABLE">
    {call create_connection(#{toaName,mode = IN,jdbcType=VARCHAR}, #{toaBundleIf, mode = IN,jdbcType=VARCHAR}, #{computeServer, mode=IN,jdbcType=VARCHAR}, #{computeServerIf, mode=IN,jdbcType=VARCHAR}, #{purpose, mode=IN,jdbcType=VARCHAR}, #{configPhase, mode=IN,jdbcType=VARCHAR}, #{status, mode=IN,jdbcType=VARCHAR}, #{lagProfile, mode=IN,jdbcType=VARCHAR}, #{comment, mode=IN,jdbcType=VARCHAR}, #{connectionId, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorCode, mode=OUT, javaType=int, jdbcType=INTEGER}, #{errorMsg, mode=OUT, javaType=java.lang.String, jdbcType=VARCHAR})}
 </insert>   

I am filling all the input in RCTConnectionWrapper class and expecting to be also set in the fields of the same class.

I see mysql doesn't like the OUT parameter to be passed this way. It's complaining about argument 10 which is the first OUT argument. Is there any other work around for this?

Sreekanth

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="DgqmPwZaAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.