QueryTurnaround

QueryTurnaround

QueryTurnaround.asmx

This web service lets the user execute the SQL query.

 

ExecuteQuery

Usage:
ExecuteQueryResult = A.ExecuteQuery(UserName, UserPassword, query, numberOfRecords)
Parameters UserName and UserPassword are not used at this moment.

 

Input Parameters

Parameter

Type

Detail

query

String

System will automatically add “SELECT ” to the query string. For example, if user wants to execute SQL command “SELECT ORDER_NO FROM CPORDHDR,” he/she needs to set this query string as “ORDER_NO FROM CPORDHDR.”

numberOfRecords

String

Maximum number of returned records.

 

ExecuteQueryResult Structure

Property Name

Type

Detail

ReturnCode

Integer

0 = OK

10001 = missing query

Data

DataSet

Contains a data table (table name “Data”). The rows in data table depends on your query.

ReturnMsg

String

If a database error is encountered, the error number is returned in the ReturnCode property and the error message text is return in the ReturnMsg property.

 

Code Example

The following sample code will make an order inquiry.


Dim Service As New webServicesQueryTurnaround.QueryTurnaround()
Dim Result As New webServicesQueryTurnaround.ExecuteQueryResult
Dim query As String = “ORDER_NO, ORDER-DATE, ORDER-TYPE, ORDER-SHIP-TO-NO FROM CPORDHDR WHERE ORDER_NO > 112487 AND ORDER_NO < 115877”
Dim numberOfRecords As String = “999”
Result = Service.ExecuteQuery(“”, “”, query, numberOfRecords)
If Result.ReturnCode = 0 Then
  If Result.Data.Tables(0).Rows.Count > 0 Then
     lblResult.Text = “First Matching Order No. is” & _
      Result.Data.Tables(0).Rows(0).Item("ORDER_NO")
  Else
     lblResult.Text = “No Matching Order.”
  End If
Else
  lblResult.Text = “Error”
  lblErrorCode.Text = Result.ReturnCode.ToString + ': " + Result.ReturnMsg
End If


QueryTurnAround Return Code

0 = OK
30000 = Database Error
30001 = No Record Found or web services is not turned on in Global Setup
30002 = General Error




    • Related Articles

    • A Case to Optimize PSQL Query Performance with INNER JOIN SYCONTCT & SYCONREL Tables

      Release Date: 11/29/2023 Version: 7.x & Up Q - With our custom web application, we attempt to find an existing customer and associated contact when creating new customers via the Elliott web services. We are finding the customer just fine, but when I ...
    • The Lessons We Learned from Upgrading Web Service 8.2 to 8.5 in eStore

      Elliott Web Service 8.5 changed ORDER_NO, INV_NO, and other keys from numeric to alphanumeric to accommodate a bigger range. This results in changes in the Web Service interface. This article documents our experience when we upgraded the Web Service ...
    • Elliott API (JSON REST Web Service)

      Introduction In the past, Elliott web services is based on SOAP standard since that is the first web services standard created for the industry. Since then, RESTful APIs (Representational State Transfer) have become the backbone of modern web ...