Namespace: Consultingwerk.Util
Class 
DatabaseHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:DatabaseHelper
Purpose:Provides helper routines working with the database
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Tue Jan 18 20:36:21 CET 2011



Top Method Summary
Options Name Purpose
+ CreateDatabaseAliases (character) Creates database aliases based on a configuration string
+ INTEGER DatabaseNumber (character) Returns the sequence number of a database the ABL session is connected to. This sequence number can be used for functions like LDBNAME or the return-value of the GetRecordsReads() method in this class
+ CHARACTER GetDbNameSignature () Returns a comma-delimited list of the logical database names of all connected database names, all alias names and the logical name of the DICTDB
+ RECID GetDictDbRecid () Returns the RECID of the _DB record
+ INT64 GetRecordReads () Returns an int64 array containing the _ActSummary._Summary-RecReads for every connected database
+ INT64 GetRecordReads (int64[]) Returns an int64 array containing the _ActSummary._Summary-RecReads for every connected database substracted by the values in a start array.
+ SetDbClient (handle, character) Sets the DB-CLIENT
+ CHARACTER UnabbreviatedFieldName (character, character) Returns the unabbreviated field name based on an abbreviated field name
+ CHARACTER UnabbreviatedTableName (character) Returns the unabbreviated table name based on an abbreviated table name
+ CHARACTER UnabbreviatedTableName (character, character) Returns the unabbreviated table name based on an abbreviated table name

Top Constructor Summary
Options Name Purpose
# DatabaseHelper () Constructor for the DatabaseHelper class


Method Detail
Top

PUBLIC CreateDatabaseAliases (character)

Purpose: Creates database aliases based on a configuration string
Notes: The configuration string is a pipe delimited list of
LDBNAME:ALIASNAME ALIASNAME or LDBNAME:ALIASNAME1&ALIASNAME2&...&ALIASNAMEn
sports2000:appdb&dictdb|icfdb:afdb appdb&dictdb|icfdb:afdb

Parameters:
pcAliases CHARACTER
The definition of the aliases to create
Top

PUBLIC INTEGER DatabaseNumber (character)

Purpose: Returns the sequence number of a database the ABL session is connected
to. This sequence number can be used for functions like LDBNAME or
the return-value of the GetRecordsReads() method in this class
Notes:

Parameters:
pcDatabaseName CHARACTER
The logical database name to return the connect sequence number for
Returns INTEGER
The sequence number of a database the ABL session is connected to or ? when the DB is not connected
Top

PUBLIC CHARACTER GetDbNameSignature ()

Purpose: Returns a comma-delimited list of the logical database
names of all connected database names, all alias names
and the logical name of the DICTDB
Notes:

Returns CHARACTER
The comma-delimited signature of the connected database
Top

PUBLIC RECID GetDictDbRecid ()

Purpose: Returns the RECID of the _DB record
Notes: Required for invoking some of the data dictionary, data admin API's

Returns RECID
The RECID of the DICTDB _DB record
Top

PUBLIC INT64 GetRecordReads ()

Purpose: Returns an int64 array containing the _ActSummary._Summary-RecReads
for every connected database
Notes:

Returns INT64
The INT64[] containing the _ActSummary._Summary-RecReads per connected DB
Top

PUBLIC INT64 GetRecordReads (int64[])

Purpose: Returns an int64 array containing the _ActSummary._Summary-RecReads
for every connected database substracted by the values in a start
array.
Notes: This function is useful for computing the actual number of records
read since the GetRecordsReads() (no parameter) methods was called

Parameters:
iStart INT64
An INT64[] containing the start offset for the records read
Returns INT64
The INT64[] containing the _ActSummary._Summary-RecReads per connected DB since the offset was taken
Top

PUBLIC SetDbClient (handle, character)

Purpose: Sets the DB-CLIENT
Notes: Wrapper to SET-DB-CLIENT with better error reporting

Parameters:
phClientPrincipal HANDLE
The handle of the client-principal
pcLogicalDatabaseName CHARACTER
The logical database name
Top

PUBLIC CHARACTER UnabbreviatedFieldName (character, character)

Purpose: Returns the unabbreviated field name based on an abbreviated field
name
Notes:

Parameters:
pcTableName CHARACTER
The table name (possibly abbreviated)
pcFieldName CHARACTER
The field name (possibly abbreviated)
Returns CHARACTER
The unabbreviated field name
Top

PUBLIC CHARACTER UnabbreviatedTableName (character)

Purpose: Returns the unabbreviated table name based on an abbreviated table
name
Notes:

Parameters:
pcTableName CHARACTER
The abbreviated table name, optionally with DB prefix
Returns CHARACTER
The unabbreviated buffer name (including database name)
Top

PUBLIC CHARACTER UnabbreviatedTableName (character, character)

Purpose: Returns the unabbreviated table name based on an abbreviated table
name
Notes:

Parameters:
pcDatabaseName CHARACTER
The database name
pcTableName CHARACTER
The abbreviated table name
Returns CHARACTER
The unabbreviated buffer name (including database name)


Constructor Detail
Top

PROTECTED DatabaseHelper ()

Purpose: Constructor for the DatabaseHelper class
Notes: Disallow instance creation



©2006-2019 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.08.2019 23:57:00