Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Query generating with $defaultValuesClause

    Hi team,
    I am creating an update DSRequest on server and setting values in it. when I execute the query is created like below:
    Code:
    UPDATE employee SET  $defaultValuesClause  WHERE (employee.employee_id=2)
    This query breaks by giving error that the update query is not fully formed. I can't find any detail about $defaultValuesClause. My dsRequest values contains the primary key id as well.

    Thanks in advance.

    #2
    Please, we have reminded you so many times, it’s just absurd that you continue to post woefully incomplete requests for support.

    Version, logs, etc please.

    Comment


      #3
      My bad, I thought the generated query and $defaultValuesClause will do.

      Code:
      DSRequest dsRequest= new DSRequest("Employee", DSOperationType.UPDATE.getValue(), rpcManager);
      dsRequest.setValues(fields);   // this map contains just the primaryKeyId
      LOGGER.debug(SQLDataSource.getSQLClause(SQLClauseType.All, dsRequest));     
      //generated SQL is   UPDATE employee SET $defaultValuesClause WHERE (employee.employee_id=2)
      return dsRequest.execute();
      Exception:
      Code:
       
       java.lang.Exception: Insert, update or replace operation is not a full query; check DataSource configuration (operationBinding, valuesClause);check submitted parameters (valuesClause, command) for opertaion. 	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1314) 	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:306) 	at com.isomorphic.sql.SQLDataSource.executeUpdate(SQLDataSource.java:254)

      Comment


        #4
        Hi preeti_kanyal,

        what SQL do you expect for an update without any values for a SET and just criteria for the WHERE?

        Best regards
        Blama

        Comment


          #5
          dsRequest.setValues(fields); // this map contains just the primaryKeyId
          You are asking for a SQL update but you have passed only the primaryKey. So there is nothing to update.. what else could you possible expect here?

          Comment

          Working...
          X