Execute SQL statement
POST
/api/v1/catalogs/execute-sql
const url = 'https://example.com/api/v1/catalogs/execute-sql';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"sql":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/catalogs/execute-sql \ --header 'Content-Type: application/json' \ --data '{ "sql": "example" }'Executes a SQL statement in a Databricks SQL warehouse using environment configuration.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
SqlExecuteRequest
Request to execute a SQL statement.
object
sql
required
Sql
SQL statement to execute
string
Examplegenerated
{ "sql": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
SqlExecuteResponse
Response from executing a SQL statement.
object
sql
required
Sql
string
result
required
Result
status
required
Status
string
Examplegenerated
{ "sql": "example", "result": "example", "status": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}