com.marklogic.xcc

## Interface AdhocQuery

- All Superinterfaces:
    Request

      public interface AdhocQuery
      extends Request

  A specialization of `Request` which contains an ad-hoc query (XQuery code as a literal String) to be submitted and evaluated by the MarkLogic Server.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getQuery()` Returns the currently set ad-hoc XQuery string.
    `void` | `setQuery(java.lang.String query)` Replace the XQuery code to be submitted and evaluated with this `Request`.

    - ### Methods inherited from interface com.marklogic.xcc.Request

      `clearVariable, clearVariables, getCount, getEffectiveOptions, getOptions, getPosition, getSession, getVariables, setCount, setNewIntegerVariable, setNewIntegerVariable, setNewStringVariable, setNewStringVariable, setNewVariable, setNewVariable, setNewVariable, setNewVariables, setNewVariables, setNewVariables, setOptions, setPosition, setVariable`

- - ### Method Detail

    - #### setQuery

          void setQuery(java.lang.String query)

      Replace the XQuery code to be submitted and evaluated with this `Request`.
      Parameters:
        `query` -

    - #### getQuery

          java.lang.String getQuery()

      Returns the currently set ad-hoc XQuery string.
      Returns:
        A String which is the ad-hoc query to run when this `Request` is next passed to `Session.submitRequest(Request)`.

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com