Search Results for

    Show / Hide Table of Contents

    Class AdbTableCommand

    An optional service that executes predefined commands (table truncate, drop, delete rows, exists) on table-like objects. This simplifies executing these commands and assists with writing provider-independent database code, and is available as TableCommand. Also see HasTableCommandService, AdbTableInformation, AdbDataSourceInformation and AdbConnection.

    Inheritance
    Object
    AdbTableCommand
    Implements
    IAdbTableCommandService
    Namespace: actionETL.Adb
    Assembly: actionETL.dll
    Syntax
    public class AdbTableCommand : IAdbTableCommandService

    Methods

    DeleteRowsAsync(String)

    Delete all rows in a table-like object (e.g. table or view).

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public Task<OutcomeStatusResult<int>> DeleteRowsAsync(string compositeTableName)
    Parameters
    Type Name Description
    String compositeTableName

    Table to delete rows from. Can be a composite name.

    Returns
    Type Description
    Task<OutcomeStatusResult<Int32>>

    On success, Status will be Succeeded, and Result will be the number of rows affected.

    On failure, Status will have a failure status, and Result will be undefined.

    An incorrect parameter will throw immediately. Any other exceptions or failures will be caught and contained in the returned OutcomeStatus, which should then be logged by the caller.

    See the provider documentation for specific Open() exceptions. Some providers may throw if the connection is associated with a transaction.

    Exceptions
    Type Condition
    ArgumentException

    compositeTableName - Cannot not be null or whitespace.

    DropTableAsync(String, Boolean)

    Drop a table.

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public Task<OutcomeStatus> DropTableAsync(string compositeTableName, bool ifExists)
    Parameters
    Type Name Description
    String compositeTableName

    Table to drop. Can be a composite name.

    Boolean ifExists

    If true, only drop the table if it exists. If false, always drop the table, which will fail if it doesn't exist.

    Returns
    Type Description
    Task<OutcomeStatus>

    An OutcomeStatus, with Succeeded on success; otherwise one of the failure states.

    Exceptions
    Type Condition
    ArgumentException

    compositeTableName - Cannot not be null or whitespace.

    DropViewAsync(String, Boolean)

    Drop a view.

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public Task<OutcomeStatus> DropViewAsync(string compositeViewName, bool ifExists)
    Parameters
    Type Name Description
    String compositeViewName

    View to drop. Can be a composite name.

    Boolean ifExists

    If true, only drop the view if it exists. If false, always drop the view, which will fail if it doesn't exist.

    Returns
    Type Description
    Task<OutcomeStatus>

    An OutcomeStatus, with Succeeded on success; otherwise one of the failure states.

    Exceptions
    Type Condition
    ArgumentException

    compositeViewName - Cannot not be null or whitespace.

    TruncateTableAsync(String)

    Truncates a table.

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public Task<OutcomeStatus> TruncateTableAsync(string compositeTableName)
    Parameters
    Type Name Description
    String compositeTableName

    Table to truncate. Can be a composite name.

    Returns
    Type Description
    Task<OutcomeStatus>

    An OutcomeStatus, with Succeeded on success; otherwise one of the failure states.

    Exceptions
    Type Condition
    ArgumentException

    compositeTableName - Cannot not be null or whitespace.

    Implements

    IAdbTableCommandService

    See Also

    HasTableCommandService
    AdbTableInformation
    AdbDataSourceInformation
    AdbConnection
    In This Article
    Back to top Copyright © 2023 Envobi Ltd