SqlService :: ExecuteQuery

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:
  • string query (SQL),

Run Query SQL, not result.

Input parameters:

{
    "query":"UPDATE F_COMPTET SET CT_CodeRegion = 'Lorraine' WHERE CT_Ville ='Metz' AND ISNULL(CT_CodeRegion,'')=''"
}

Example:

require (__DIR__ . '/service/WebServices100.php');

use services\WebServices100;

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/SqlService/rest/ExecuteQuery';

// add parameters
$data = new stdClass();
$data->query = "UPDATE F_COMPTET SET CT_CodeRegion = 'Lorraine' WHERE CT_Ville ='Metz' AND ISNULL(CT_CodeRegion,'')=''";

$json_data = json_encode($data);

// Send requests to receive data
$result = WebServices100::getData($url, $json_data);

// Transform the structure of the JSON returned to work in PHP
$response = $result;

Result:

NO RESPONSE