Execute a query
queries_post( database, sql, preview_rows, credential = NULL, hidden = NULL, interactive = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, unquoted = NULL, filename_prefix = NULL )
database | integer required. The database ID. |
---|---|
sql | string required. The SQL to execute. |
preview_rows | integer required. The number of rows to save from the query's result (maximum: 100). |
credential | integer optional. The credential ID. |
hidden | boolean optional. The hidden status of the item. |
interactive | boolean optional. Deprecated and not used. |
include_header | boolean optional. Whether the CSV output should include a header row [default: true]. |
compression | string optional. The type of compression. One of gzip or zip, or none [default: gzip]. |
column_delimiter | string optional. The delimiter to use. One of comma or tab, or pipe [default: comma]. |
unquoted | boolean optional. If true, will not quote fields. |
filename_prefix | string optional. The output filename prefix. |
A list containing the following elements:
integer, The query ID.
integer, The database ID.
string, The SQL to execute.
integer, The credential ID.
array, A preview of rows returned by the query.
array, A preview of columns returned by the query.
integer, The ID of the script associated with this query.
string, Deprecated and not used.
string, The error message for this run, if present.
string,
string,
string, The end time of the last run.
string, The state of the last run.
integer, The ID of the last run.
boolean, The hidden status of the item.
boolean, Deprecated and not used.
integer, The number of rows to save from the query's result (maximum: 100).
boolean, Whether the CSV output should include a header row [default: true].
string, The type of compression. One of gzip or zip, or none [default: gzip].
string, The delimiter to use. One of comma or tab, or pipe [default: comma].
boolean, If true, will not quote fields.
string, The output filename prefix.
string, The start time of the last run.
integer, The ID of the report associated with this query.