Announcement

Collapse
No announcement yet.

Error with sequence

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error with sequence

    I am trying to obtain a number of a sequence into a transformer step:

    Code:
    var id = dbConn.executeCachedQuery("SELECT ID_SECUENCIA.NEXTVAL FROM DUAL"«»);
    	
    if ( id.next() != 0 ) 
    {
    	var id_string = id.getString(1);
    }
    id.close();
    dbConn.close();
    connectorMap.put('ID', id_string);
    But when I execute the query, it returns the mistake:

    Wrapped java.sql.SQLException: Invalid scale size. Cannot be less than zero

    Some idea?

  • #2
    Re:Error with sequence

    Try with a column alias, like, "SELECT ID_SECUENCIA.NEXTVAL AS NEWID FROM DUAL".

    Hope it helps!

    Comment


    • #3
      Re:Error with sequence

      I'm afraid than not.

      Code:
      FAILURE: Error evaluating transformer
      MirthJavascriptTransformerException
      
      CHANNEL:
      AYUDA - Rutas
      CONNECTOR:
      PRUEBAS
      SCRIPT SOURCE:
      Transformer
      LINE NUMBER:
      49
      DETAILS:
      Wrapped java.sql.SQLException: Invalid scale size. Cannot be less than zero
      What does indicate the number of line?

      In log I see:

      Code:
      ERROR 2007-11-29 18:26:49,816 [4217a015-f594-439c-ad14-519c386d03f6_source_connector._jdbcEndpoint#197136197.receiver.3] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: 4217a015-f594-439c-ad14-519c386d03f6: org.mule.umo.routing.RoutingException: Failed to route event via endpoint: null. Message payload is of type: com.webreach.mirth.model.MessageObject

      Comment


      • #4
        Re:Error with sequence

        Hi Orande.

        The problem is related to the SQL, an the line 48 is probably the 'dbConn.executeCachedQuery' line.

        To isolate the problem, try the SQL sentence using a java based sql program (db visualizer, aqua data studio, etc...) with the user/pass of the JDBC.

        Searching the problem at internet, it seems related to the JDBC driver.

        Try with the next sentence:

        "SELECT (ID_SECUENCIA.NEXTVAL+0) AS NEWID FROM DUAL".

        Comment


        • #5
          Re:Error with sequence

          Thanks!! :laugh:

          It work!! :woohoo:

          Comment


          • #6
            Re:Error with sequence

            Hi,

            I am using the following code, but getting the same problem.


            var dbConn = DatabaseConnectionFactory.createDatabaseConnection ("oracle.jdbc.OracleDriver", "jdbcracle:thin:@255.255.255.0:1521rcl", "faisal", "faisal");
            var result = dbConn.executeCachedQuery("SELECT ID, NAME, ADDRESS FROM HL_DATA");
            result.next();
            //tmp['PID']['PID.5']['PID.5.3'] = "Test";
            tmp['PID']['PID.5']['PID.5.3'] = result.getInt(1);
            result.close();
            dbConn.close();



            Rgds

            Faisal

            Comment

            Working...
            X