Class DatabaseOperationTask
- Namespace
- ArcanaDevelopment.adTempus.Client
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
Represents a Database Operation Task.
[ComVisible(true)]
[Guid("53C24C25-E465-41BD-9282-C9B39783E830")]
public sealed class DatabaseOperationTask : Task
- Inheritance
-
objectDatabaseOperationTask
Remarks
Saving data to a file
>To save selected data to a file:
- Set ActionType to SelectResultset
- Set ImportExportFormat to the desired format
- DataSet: The data is written using the .NET DataSet.WriteXml method. Data can be read into a DataSet using DataSet.ReadXml.
- CSV (Requires server version 6.0 or later): The data is written in CSV format. If the query produces more than one data table (e.g., multiple select statements), each table is written to a separate file with a numeric suffix added to the name, e.g., "myfile-1.csv", "myfile-2.csv".
- Set TargetFile to the destination file name
Properties
ActionType
The type of action to perform
public DatabaseTaskType ActionType { get; set; }
Property Value
Remarks
AdditionalConnectionOptions
Additional options to be appended to the database connection string.
[CanBeNull]
public string AdditionalConnectionOptions { get; set; }
Property Value
- string
ClassID
The Class ID for the object
[IgnoreDataMember]
public override ClassID ClassID { get; }
Property Value
ClassKeyName
The key name for the class.
public override string ClassKeyName { get; }
Property Value
- string
Remarks
This name the name used by adTempus to identify the class and is intended for programmatic use only. Use the ClassName for a user-friendly name.
CommandTimeout
The timeout to use when executing commands and queries against the database.
[CanBeNull]
[RequiredVersion(5, 0, 0, 0)]
public TimeSpan? CommandTimeout { get; set; }
Property Value
- TimeSpan?
Remarks
If no value (or a value of 0) is specified, the default timeout is used (taken from Server Option "DatabaseOperation:CommandTimeout").
CommandsToExecute
The commands to execute if ActionType is ExecuteSQL, SelectScalar, or SelectResultset
public string CommandsToExecute { get; set; }
Property Value
- string
CustomConnectionString
Specify a full OleDb connection string to use.
[CanBeNull]
public string CustomConnectionString { get; set; }
Property Value
- string
Remarks
Use "{userid}" and "{password}" to insert user ID and password values from the CredentialProfile.
If CustomConnectionString is set, ServerName, DatabaseName, SchemaName, and AdditionalConnectionOptions are ignored.
DatabaseCredentials
The database credentials to use
[CanBeNull]
public CredentialProfile DatabaseCredentials { get; set; }
Property Value
Remarks
Set to null to use integrated security (uses the identity that the job is running under).
DatabaseName
The database name.
[CanBeNull]
public string DatabaseName { get; set; }
Property Value
- string
Remarks
For Oracle connections, specify the service name if not using TNS for the connection (see Remarks in ServerName).
DatabaseType
The type of database to connect to.
[CanBeNull]
public string DatabaseType { get; set; }
Property Value
- string
Remarks
Specify a value from DatabaseTypes.
ImportExportFormat
The format used when ActionType is SelectResultset, ExportData, or ImportData
public DatabaseImportExportType ImportExportFormat { get; set; }
Property Value
IsDependent
Indicates whether the object is a dependent of (owned by) another object
[IgnoreDataMember]
public override bool IsDependent { get; }
Property Value
- bool
Remarks
An independent object (IsDependent is false) is an object that can exist on its own without being part of another object. For example, Jobs, Job Groups, etc.
A dependent object (IsDependent is true) is a part of another object. For example, a JobStep cannot exist independently of a Job, so the JobStep is dependent.
Dependent objects cannot be directly fetched from the server: they are only fetched as part of the object they belong to. They also cannot be saved or deleted independently: they are automatically saved or deleted when the owning object is saved or deleted.
JobName
The name of the job to run when ActionType is ExecuteJob
[CanBeNull]
public string JobName { get; set; }
Property Value
- string
Remarks
This value is not validated by adTempus.
ProviderName
The OleDb provider name to use, if other than the default.
public string ProviderName { get; set; }
Property Value
- string
SchemaName
The schema to use
[CanBeNull]
public string SchemaName { get; set; }
Property Value
- string
ServerName
The database server (host) name or address.
[CanBeNull]
public string ServerName { get; set; }
Property Value
- string
Remarks
To use a port other than the default, specify it using "servername:portnumber".
Setting the ServerName clears any existing value for the CustomConnectionString.
For Oracle connections:
- To connect using TNS, set ServerName to the TNS alias and leave DatabaseName empty.
- To connect without TNS, set ServerName to the server host name and set DatabaseName to the service name.
For ODBC connections: Set the ServerName to the ODBC DSN (alias) if not using a CustomConnectionString
SupportedResponseEvents
Gets a list of the events that are supported for Responses associated with this task.
public override ReadOnlyCollection<SupportedResponseEvent> SupportedResponseEvents { get; }
Property Value
- ReadOnlyCollection<SupportedResponseEvent>
TargetFile
The file to export to if ActionType is ExportData or SelectResultset.
[CanBeNull]
public string TargetFile { get; set; }
Property Value
- string
Remarks
The file format to be used is specified by ImportExportFormat.
TargetScript
The script to pass the selected data to when ActionType is SelectResultset
[CanBeNull]
public Script TargetScript { get; set; }
Property Value
TargetVariable
The name of the variable to update when ActionType is SelectScalar
[CanBeNull]
public string TargetVariable { get; set; }
Property Value
- string
Remarks
The variable value is set only for the executing instance of the job. The variable does not need to be defined before job execution; it is created if necessary.
WaitForCompletion
Determines whether the task waits for the job to complete
public bool WaitForCompletion { get; set; }
Property Value
- bool
Remarks
When ActionType is ExecuteJob, set WaitForCompletion to true to have the task wait for the database job to complete and set the result of the task based on the database job outcome. If WaitForCompletion is false the task does not wait for the database job to complete and the result of the task indicates only whether the database job was successfully submitted.
Methods
GetObjectDescription()
Gets a description of the object's key settings.
protected override string GetObjectDescription()
Returns
- string
Remarks
This method is called by GetDescription to get a user-friendly description of the object (such as its key settings) for display to the user. The description should contain enough information to distinguish this object from others of the same class.
WriteToConfigurationReport(IADTObjectConfigurationReportWriter)
Writes the object and any contained objects to a configuration report
public override void WriteToConfigurationReport(IADTObjectConfigurationReportWriter reportBuilder)
Parameters
| Name | Type | Description |
|---|---|---|
reportBuilder |
IADTObjectConfigurationReportWriter | The report builder to write the object to. |
Inherited Members
- UserInterfaceExtensionID
- UserInterfaceExtensionData
- DescriptionOverride
- JobStep
- LastModified
- CreationTimestamp
- FromController
- CustomProperties
- Description
- DescriptionTextType
- OID
- BindingDescription
- ToString()
- ParentObject
- CanPerform(SecurityPermission)
- Duplicate()
- DataContext
- AccessMask
- Validate(MessageCollection)
- SupportedSecurityActions
- SupportedSecurityInheritanceOptions
- GetTopLevelOwner()
- GetConfigurationReport()
- GetConfigurationReport(bool)
- IsReadOnly
- IsDirty
- IsNew
- IsStub
- ClassName
- GetDescriptionWithClassName()
- GetDescription()
- BeginEdit()
- BeginEdit(UndoLevelAction)
- CommitEdit(Guid)
- CommitEdit()
- UndoEdit()
- UndoEdit(Guid)