SBM ModScript Reference → Programming SBM ModScript → Shell Properties → Shell Property Descriptions → Database Import Shell Properties
Database import shell property accessors are defined when importing data from a generic ODBC database.
Variant& containing string (read-only). Specifies the operation of the data import on the current item. Possible values are add (add a new item) and update (update an existing item).
Variant& containing int (read-only). ID of the current Import Option Set record.
Variant& containing Log object. The Log object is a complex object used to log messages into the DBImport log file. The logging levels defined in the Log object are minimal, average, and verbose. The message function defined in the Log object logs messages directly into the DbImport log using the following syntax:
Message ( Logging Level ( Int ), Message ( String ) )
For example:
var Log = Shell.ImportLog(); Log.Message ( Log.MINIMAL, "Message Logged at Minimal Logging Level" ); Log.Message ( Log.AVERAGE, "Message Logged at Average Logging Level" ); Log.Message ( Log.VERBOSE, "Message Logged at Verbose Logging Level" );
See Log.
Variant& containing string (read-only). Name of the current Import Option Set record.
Variant& containing Dictionary (key(string), object (DbImport) (read-only).
Key
The key string contains the source column name and optionally the destination (SBM) field ID. Keys that contain only the source column name are unmapped source values available for processing via the script. All mapped keys will use the '.' as a separator followed by the SBM field database name. For example, issuetype.ISSUETYPE, state.STATE, title.TITLE, color.COLOR_SINGLE_SELECTION, issueid.ISSUEID, id.
See Dictionary and DbImport.
The following example will iterate through all values contained within the Source Dictionary:
var source = Shell.Source();
for ( dbImport : source ) {
//do something with dbImport
}
Value
DbImport DbImport is a class that contains values representing the source database values:
SrcColumn
string The database column from the source database.
SrcType
integer The database column type from the source database. The following database data types are supported:
SrcData
string/integer The actual data from the source database.
SrcLabel
string If an "Int" type value maps to a reference table, this string value represents the label from the source database.
DestFldId
integer If mapped, this value represents the destination (SBM) field ID.
Variant& containing AppDB object. The source database object. Provides database I/O functionality. See AppDb.
Copyright © 2007–2020 Micro Focus or one of its affiliates. All rights reserved.