---
title:  PUT /gemfire-api/v1/queries/{queryId}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Update a named, parameterized query.

## Resource URL

``` pre
http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries/{queryId}
```

## Parameters

<table>
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="34%" />
</colgroup>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Description</th>
<th>Example Values</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>q</td>
<td>OQL String</td>
<td><p>&quot;SELECT DISTINCT from /customers WHERE lastName=$1&quot;</p></td>
</tr>
</tbody>
</table>

**Note:**
For this release, you cannot specify the query string inside the request body (as JSON). You must specify the query as a URL parameter.

## Example Request

``` pre
PUT /gemfire-api/v1/queries/selectOrders?q="SELECT DISTINCT from /customers where lastName=$1"

Accept: application/json
Content-Length: <#-of-bytes>
```

## Example Success Response

``` pre
Response Payload:  null

200 OK
```

## Error Codes

<table>
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead>
<tr class="header">
<th>Status Code</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>401 UNAUTHORIZED</td>
<td>Invalid Username or Password</td>
</tr>
<tr>
<td>403 FORBIDDEN</td>
<td>Insufficient privileges for operation</td>
</tr>
<tr>
<td>404 NOT FOUND</td>
<td>QueryID does not exist</td>
</tr>
<tr class="odd">
<td>500 INTERNAL SERVER ERROR</td>
<td>Error encountered at <%=vars.product_name%> server. Check the HTTP response body for a stack trace of the exception.</td>
</tr>
</tbody>
</table>

## Implementation Notes

This operation is idempotent, meaning multiple identical requests should have the same effect as the initial request.


