Method Community

 

Select distinct values with MethodAPISelect_DataSetV2 operation

Last post 08-28-2015 4:07 PM by Method_Jonathan. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-06-2015 12:06 PM

    Select distinct values with MethodAPISelect_DataSetV2 operation

    Hello,

    I have using the api to select four columns from a Method table, no problem.

    However when I used the DISTINCT keyword in the fields portion of the call, the response was blank instead of success. The response was:
    <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "" ></MethodAPI>

    Since there is no error I'm not sure what my next step is.

    Is using DISTINCT allowed with the Method API?
    What is the proper way to have the API give you distinct values?

    Thanks.

  • 08-28-2015 4:07 PM In reply to

    Re: Select distinct values with MethodAPISelect_DataSetV2 operation

    Hi Salamander,

    We are expecting a list of field names here, and do not accept additional SQL clauses such as 'DISTINCT'.  You can try using the the strGroupByClause to group your results by the field you are wanting to be DISTINCT in order to return a unique dataset, otherwise you will have to perform processing after retrieving values to derive a unique dataset. 

    Jonathan Gamble
    Product Manager
    Method Integration Inc.
    Local and overseas: 416.847.0400
    Toll Free: 1.888.925.6238
    Fax: 416.640.6027
    E-mail: j.gamble@method.me
Page 1 of 1 (2 items)