bw_table_query_sql
Run OpenSQL queries against SAP BW via ADT SQL Console. Pass SQL inline or from a file; use outputPath to save full results.
Instructions
Run an arbitrary OpenSQL statement via ADT Data Preview freestyle (POST /sap/bc/adt/datapreview/freestyle — same as ADT SQL Console). Pass the statement inline (sqlStatementContent) or from a file (sqlStatementPath). Prefer outputPath for non-trivial results. ⚠️ Runs with the configured BW credentials — treat as a privileged data-plane operation; prefer SELECT-only statements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Optional label for the result set (not sent to the freestyle endpoint). | |
| maxRows | No | Max rows to fetch (default 50). | |
| outputPath | No | If provided, the full result is written to this path (under the workdir) and the tool returns only a small summary envelope { ok, outputPath, bytes, summary }. Objects/arrays are written as JSON; ONLY the bw_*_get_xml family writes the raw XML string as plain text (that file is directly reusable as xmlPath in a later save call). Other *_get tools (e.g. bw_dtp_get, bw_trfn_get) write the PARSED XML-to-JSON tree, not raw XML — use the matching bw_*_get_xml tool when you need the raw XML string. Use outputPath for large responses (XML, table data, logs, dataflow graphs). When set, tools skip inline pagination/projection so the file contains the complete payload. | |
| sqlStatementPath | No | Path (under the workdir) to a file containing the sqlStatement. Takes precedence over sqlStatementContent. Use bw_*_get_xml with outputPath to produce such a file. | |
| sqlStatementContent | No | Inline sqlStatement content. Mutually exclusive with sqlStatementPath. |