Start today

← Documentation

Publish a Query

Publish a Query

  1. Write the statement in the Query Console: one SELECT, INSERT, UPDATE, DELETE or MERGE. Put a ? where a caller should supply a value, for example WHERE CURRENCY = ?. You do not have to run it first.
  2. Click Create API.... The dialog shows the statement, which you can still edit. If it has fixed values in a WHERE clause or a VALUES list, Convert to Prepared Statement replaces them with ? so they become parameters.
  3. Enter an API name: letters, digits, underscore, hyphen and dot, starting with a letter. DataIQ checks the API with the server as you type and shows its method and URL, the statement it will publish, and each parameter with its type. A parameter is named after the column it is compared to, so CURRENCY = ? becomes the parameter CURRENCY. If the server would refuse the API, the dialog says why instead.
  4. Click Create. The API is live at once. See [[product:ol-dataiq/data-api-published|After Publishing]].

Fixed values stay fixed

If the statement still has a fixed value where a parameter could go, DataIQ asks before publishing. Published that way, the value cannot be changed by the caller. Replace it with ? to make it a parameter. A name already used on the connection is refused.

Turn a SQL statement with ? parameters into a data API from the Query Console.

Read more