No announcement yet.

Row count for write should be 1 and not 0

  • Filter
  • Time
  • Show
Clear All
new posts

  • Row count for write should be 1 and not 0

    I took the Workaround to call a stored procedure from Mirth channel as an example to what I as trying to accomplish.

    In the log I am getting an error when executing the stored procedure (Row count for write should be 1 and not 0). All the code is working fine, but I wanted to know if there was a reason the error was being thrown.

    I am using SQL 2005 as the database.

    Code:"New Record"«»);
    var Result;
    var MSH10 = msg['MSH']['MSH.10']['MSH.10.1'].toString();
    var sql = "execute Inv_Skip_Function '1', '" + MSH10.replace("CHPF",""«») + "'";
    var SQLExec = $g('dbMirth').executeCachedQuery(sql);;
    var iResult = SQLExec.getInt(1);
    //go to the first result 
    if (iResult != 0)
    	//Found value in Database.
    	//Transaction will be skipped.
    	Result = false
    	Result = true;
    SQLExec.close();"iResult: " + iResult);"Stored Procedure Result: " + iResult);"SQL: " + sql);
    //Return result of stored procedure.
    return Result;

    Log Results

    WARN 2007-12-21 08:41:02,706 [b8dd3fb4-d39c-470f-9208-75176a250d24_destination_1_connector.dispatcher.10] com.webreach.mirth.connectors.jdbc.JdbcMessageDisp atcher: Row count for write should be 1 and not 0
    INFO filter: New Record
    INFO filter: iResult: 0
    INFO filter: Stored Procedure Result: 0
    INFO filter: SQL: execute Inv_Skip_Function '1', 'QP03'
    INFO destination-transformer: SQL: insert into SkippedFunctionsLog values('1', 'QP03','A08')
    Reid Hospital and Healthcare

  • #2
    Re:Row count for write should be 1 and not 0

    Refer: Suppress warning?

    Previously, there was a JS workaround to call a stored procedure in the transformer/filter. As of 1.5, JS was added to the database reader and writer, which supports stored procedures and the FULL JDBC spec. The JS code is precompiled and you are using PURE Java objects so it is just as native as the non-JS db calls. The reason you can't use stored procedures in a non-JS DB connection is due to a limitation with mule under the hood. It needs to know the column and table names in order to work it's magic. When you use JS it is executing the script just like it was native, but we're bypassing Mule's db engine and letting you hit JDBC directly.
    -chrisl (Admin)

    Refer: Calling stored procedure


    • #3
      Re:Row count for write should be 1 and not 0

      That took care of it!

      Thanks for the help.
      Reid Hospital and Healthcare