Codeunit 18122338 EOS004 DB API Client

Codeunit 18122338 EOS004 DB API Client

Provides access to the DB API client of the EOS FunctionAPI.

Methods

Initialized

procedure Initialized(): Boolean

Specifies whether this instance has been correctly initialized with a service configuration.

Parameters / Return Value

  • Returns Boolean

Initialize

procedure Initialize(ConfigCode: Code[20])

Initializes this instance using the specified service configuration.

Parameters / Return Value

  • ConfigCode Code[20]

Initialize

procedure Initialize(Config: Record "EOS004 Service Config.")

Initializes this instance using the specified service configuration.

Parameters / Return Value

  • Config Record "EOS004 Service Config."

SuppressError

procedure SuppressError(value: Boolean)

Parameters / Return Value

  • value Boolean

SuppressError

procedure SuppressError(): Boolean

Parameters / Return Value

  • Returns Boolean

LastCommandDuration

procedure LastCommandDuration(): Text

Returns the duration of the last command execution.

Parameters / Return Value

  • Returns Text

ListProviders

procedure ListProviders(var result: List of [Text])

Returns a list of all available database providers in a list. This is a TryFunction.

Parameters / Return Value

  • result List[Text]

    The list of available providers.


ListProviders

procedure ListProviders(var Result: Record "Name/Value Buffer")

Returns a list of all available database providers in a Name/Value Buffer. This is a TryFunction.

Parameters / Return Value

  • Result Record "Name/Value Buffer"

CreateConnection

procedure CreateConnection(ProviderName: Text;ConnectionString: Text;DatabaseName: Text;var ConnectionId: Guid)

Creates a new connection. This is a TryFunction.

Parameters / Return Value

  • ProviderName Text

    The database provider to use.

  • ConnectionString Text

    The connection string to pass to the provider.

  • DatabaseName Text

    The name of the database to connect to.

  • ConnectionId Guid

    Will contain the ID of the created connection.


CreateConnection

procedure CreateConnection(ProviderName: Text;ConnectionString: Text;DatabaseName: Text;AdditionalProperties: Dictionary of [Text, Text];var ConnectionId: Guid)

Creates a new connection. This is a TryFunction.

Parameters / Return Value

  • ProviderName Text

    The database provider to use.

  • ConnectionString Text

    The connection string to pass to the provider.

  • DatabaseName Text

    The name of the database to connect to.

  • AdditionalProperties Dictionary[Text,Text]

    Additional provider-specific properties.

  • ConnectionId Guid

    Will contain the ID of the created connection.


CreateConnection

procedure CreateConnection(DbConnSetupCode: Code[10]; var ConnectionId: Guid)

Creates a connection from a connection setup, by code. This is a TryFunction.

Parameters / Return Value

  • DbConnSetupCode Code[10]

    The DB connection setup code.

  • ConnectionId Guid

    The created connection ID.


CreateConnection

procedure CreateConnection(DbConnection: Record "EOS004 DB Connection Setup"; var ConnectionId: Guid)

Creates a connection from a connection setup, by record. This is a TryFunction.

Parameters / Return Value

  • DbConnection Record "EOS004 DB Connection Setup"

  • ConnectionId Guid

    The created connection ID.


CloseConnection

procedure CloseConnection(ConnectionId: Guid)

Closes a connection.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID to close.


GetConnection

procedure GetConnection(ConnectionId: Guid; var Result: JsonArray)

Returns metadata about a given connection.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • Result JsonArray

    The result.


GetConnections

procedure GetConnections(var Result: JsonArray)

Returns metadata of all currently open connections.

Parameters / Return Value

  • Result JsonArray

    The result


CloseReader

procedure CloseReader(ConnectionId: Guid; ReaderId: Guid)

Closes a given data-reader on a given connection.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID

  • ReaderId Guid

    The datareader ID


ReadRows

procedure ReadRows(ConnectionId: Guid; ReaderId: Guid; BatchSize: Integer; var ResultSet: JsonArray)

Read the specified number of rows from the a given data reader on a given connection.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID

  • ReaderId Guid

    The datareader ID

  • BatchSize Integer

    The number of records to read.

  • ResultSet JsonArray

    The result.


ExecuteNonQuery

procedure ExecuteNonQuery(ConnectionId: Guid; CommandText: Text; var affectedRows: Integer)

Executes a query on a given connection ID without capturing the result.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • affectedRows Integer

    Returns the number of rows affected by the query.


ExecuteNonQuery

procedure ExecuteNonQuery(ConnectionId: Guid; CommandText: Text; TransactionId: Guid; var affectedRows: Integer)

Executes a query on a given connection ID without capturing the result.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • TransactionId Guid

    The transaction ID to execute the command on.

  • affectedRows Integer

    Returns the number of rows affected by the query.


ExecuteReader

procedure ExecuteReader(ConnectionId: Guid; CommandText: Text; var ResultSet: Codeunit "EOS004 DB ResultSet")

Executes a query on a given connection ID, capturing the result as a data-reader.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • ResultSet Codeunit "EOS004 DB ResultSet"

    The result set.


ExecuteReader

procedure ExecuteReader(ConnectionId: Guid; CommandText: Text; TransactionId: Guid; var ResultSet: Codeunit "EOS004 DB ResultSet")

Executes a query on a given connection ID, capturing the result as a data-reader.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • TransactionId Guid

    The transaction ID to execute the command on.

  • ResultSet Codeunit "EOS004 DB ResultSet"

    The result set.


ExecuteScalar

procedure ExecuteScalar(ConnectionId: Guid; CommandText: Text; var Result: JsonObject)

Executes a query on a given connection ID, capturing the result as a scalar value.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • Result JsonObject

    The result.


ExecuteScalar

procedure ExecuteScalar(ConnectionId: Guid; CommandText: Text; TransactionId: Guid; var Result: JsonObject)

Executes a query on a given connection ID, capturing the result as a scalar value.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • CommandText Text

    The command to be executed.

  • TransactionId Guid

    The transaction ID to execute the command on.

  • Result JsonObject

    The result.


CreateTransaction

procedure CreateTransaction(ConnectionId: Guid; var TransactionId: Guid)

Creates a new transation.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID to create the transaction on.

  • TransactionId Guid

    Returns the ID of the transaction that has been created.


CommitTransaction

procedure CommitTransaction(ConnectionId: Guid; TransactionId: Guid)

Commits an open transaction.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID that the transaction to commit belongs to.

  • TransactionId Guid

    The transaction ID to be committed.


RollbackTransaction

procedure RollbackTransaction(ConnectionId: Guid; TransactionId: Guid)

Rolls back an open transaction.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID that the transaction to rollback belongs to.

  • TransactionId Guid

    The transaction ID to be rolled back.


GetReaders

procedure GetReaders(ConnectionId: Guid; var Result: JsonArray)

Returns a list of all open data-readers on a given connection.

Parameters / Return Value

  • ConnectionId Guid

    The connection ID.

  • Result JsonArray



EOS Labs -