Method ExecuteTableDDLAsync
ExecuteTableDDLAsync(String, TableDDLOptions, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLAsync(string statement, TableDDLOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
TableDDLOptions | options | (Optional) Options for table DDL operation.
If not specified or null , appropriate defaults
will be used. See TableDDLOptions. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
The operations allowed are defined by the Data Definition Language (DDL) portion of the query language related to tables such as table creation and drop, index add and drop, and the ability to alter table schema and table limits.
Operations using table DDL statements infer the table name from the statement itself, e.g. CREATE TABLE MyTable(...). Table creation requires a valid TableLimits object to define the throughput and storage desired for the table. It is an error for TableLimits to be specified with a statement other than create or alter table.
Note that these are potentially long-running operations, so the result returned by this API does not imply operation completion and the table may be in an intermediate state (see TableState for more details). Call WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) on returned TableResult to asynchronously wait for the operation completion. Alternatively, you may check the status of the running DDL operation by calling GetTableAsync(TableResult, GetTableOptions, CancellationToken).
When the DDL operation is completed, the table state should be either Active or Dropped (only if the operation was DROP TABLE). To get only the final result, instead of this API, call ExecuteTableDDLWithCompletionAsync(String, TableDDLOptions, CancellationToken), which is equivalent to calling ExecuteTableDDLAsync(String, TableDDLOptions, CancellationToken) and then WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken).
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid
or options contains invalid values. |
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |
See Also
ExecuteTableDDLAsync(String, TableLimits, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLAsync(string statement, TableLimits tableLimits, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
TableLimits | tableLimits | Table limits for table creation. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid
or tableLimits is null or
contains invalid values.
|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |
See Also
ExecuteTableDDLAsync(String, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLAsync(string statement, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid.
|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |