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

File:BufferHelper
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Sep 30 14:43:37 CEST 2009



Top Method Summary
Options Name Purpose
+ AddBufferFieldsToList (handle, ListNameValuePair, logical) Adds the fields from the given Buffer Handle to the given ListNameValuePair
+ CHARACTER AllFieldNames (handle) Returns a comma-delimited list of the buffer column names
+ CHARACTER AllFieldsFindPredicate (handle) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of all fields @param phBuffer The handle of the buffer @return The QueryString predicate */
+ AssignFieldValue (handle, character, character) Assigns a Buffer Field Value from a character value
+ CHARACTER BufferCompare (handle, handle) Compare to records field by field and returns the list of different fields, performs case-sensitive comparison of character and clob fields
+ CHARACTER BufferFieldSubstitute (handle, character, character) Returns the result of a SUBSTITUTE function based on fields of a buffer handle
+ CHARACTER BufferFieldSubstitute (handle, character, character, logical) Returns the result of a SUBSTITUTE function based on fields of a buffer handle
+ CHARACTER BufferFieldSubstitute (handle, character, character, logical, ListNameValuePair) Returns the result of a SUBSTITUTE function based on fields of a buffer handle
+ CHARACTER BufferFieldSubstituteFormatted (handle, character, character, character) Returns the result of a SUBSTITUTE function based on formatted fields of a buffer handle
+ CHARACTER BufferFieldValue (handle) Returns a character representation of a buffer field value
+ HANDLE BufferHandle (BufferFieldName) Returns the handle to the database buffer referenced by the BufferFieldName object
+ CHARACTER BufferIndexByClause (handle, character, logical) Returns the by clause mathing a buffer index
+ CHARACTER BufferIndexByClause (handle, character, logical, logical) Returns the by clause matching a buffer index
+ CHARACTER BufferIndexFields (handle, character) Returns the list of fields referenced in an index
+ CHARACTER BufferLargeColumns (handle) Returns the large columns from the given buffer handle
+ CHARACTER BufferPrimaryIndexByClause (handle, logical) Returns the by clause matching a buffers primary index
+ CHARACTER BufferQueryString (character, character, character) Returns a query string for the given buffer based on a list of key fields and values
+ CHARACTER BufferQueryString (character, character, character, character) Returns a query string for the given buffer based on a list of key fields and values
+ Consultingwerk.BufferTypeEnum BufferType (handle) Determines the type of a Buffer
+ LOGICAL CanCreateDefaultRow (handle) Validates that a record can be created using the default values
+ CHARACTER ConcatenateFieldValues (handle, character, character) Concatenates the values of the given buffer fields
+ LOGICAL CopyErrorStatus (handle, handle) Copies the error-status from the source buffer to the target buffer
+ HANDLE CreateBuffer (BufferFieldName) Creates and returns a dynamic buffer based on a BufferFieldName object
+ HANDLE CreateBuffer (handle) Creates a Dynamic buffer on the fly
+ HANDLE CreateTempTableFromRecord (handle) Creates a temp-table with the current record of the provided buffer
+ HANDLE CreateTempTableFromRecord (handle, character) Creates a temp-table with the current record of the provided buffer
+ CHARACTER FieldSerializeName (handle) Returns a buffer fields SERIALIZE-NAME when set, otherwise the fields NAME
+ CHARACTER FieldValueList (handle, character) Returns a delimited list of field values
+ CHARACTER FieldValueList (handle, character, character) Returns a delimited list of field values
+ CHARACTER FieldWithSerializeName (handle, character) Returns the name of the buffer field with the given SERIALIZE-NAME
+ FindAfterBuffer (handle) Finds the before buffer's after-buffer record
+ FindBeforeBuffer (handle) Finds the after buffer's before-buffer record
+ FindDatabaseBuffer (handle, handle, character) Finds the database record for a linked (ProDataset data-source) record in a ProDataset.
+ FindDatabaseBuffer (handle, handle, character, LockModeEnum) Finds the database record for a linked (ProDataset data-source) record in a ProDataset.
+ GetFieldNameAndExtent (character, character, integer) Returns the name and extent of the field name
+ Consultingwerk.Framework.Collections.CharacterDictionary GetFieldValues (handle, character) Returns a dictionary with field values of the given buffer
+ LOGICAL HasChanges (handle, character) Returns if the provided ProDataste temp-table buffer handle has changes in the provided field list
+ LOGICAL HasField (handle, character) Tests if the passed in buffer handle has a field with the given name
+ LOGICAL HasFields (handle, character) Tests if the passed in buffer handle has all fields with the given names
+ LOGICAL IsDatabaseBuffer (handle) Returns TRUE when the passed in Buffer Handle is a buffer handle for a database table
+ LOGICAL IsUniqueFieldCombination (handle, character) Returns if the provided list of field names is unqiue
+ CHARACTER NewGuidWhenEmpty (handle, character) Assigns a new GUID value to a buffer field when the buffer field is empty or ?
+ NullifyUniqueIndexFields (handle) Nullify (?) all unique index field values
+ INT64 NumRecords (character) Returns the number of records available in the table
+ INTEGER NumRecords (handle) Returns the number of records available in the Buffer
+ Consultingwerk.BufferFieldName ParseFieldName (character) Parses a field name
+ ParseSaxAttributesToBuffer (handle, handle) Assigns buffer field values from SAX-ATTRIBUTES
+ ParseSaxAttributesToBuffer (handle, handle, logical) Assigns buffer field values from SAX-ATTRIBUTES
+ CHARACTER QualifiedFieldName (handle) Returns the qualified field name of a buffer field
+ CHARACTER QualifiedTableName (handle) Returns the qualified table name of a buffer
+ ResetToInitialValueExcept (handle, character) Resets all fields of a buffer to their inital value, except the given list of fields
+ ShowBuffer (handle) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, character) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, integer) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, integer, character) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, integer, logical) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, integer, logical, character) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, logical) Shows buffer field values on the screen using the MESSAGE statement
+ ShowBuffer (handle, logical, character) Shows buffer field values on the screen using the MESSAGE statement
+ CHARACTER SourceBufferMapping (handle, character) Returns the DATA-SOURCE field mapping for the given source buffer
+ CHARACTER ToBufferNameFieldName (character) Converts a field name specified as either db.table.field or buffer.field to buffer.field
+ INTEGER TotalNumberOfFields (handle) Returns the total number of fields in a Buffer including Array fields as individual columns
+ CHARACTER UniqueFindPredicate (handle) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns
+ CHARACTER UniqueFindPredicate (handle, character) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns
+ CHARACTER UniqueFindPredicate (handle, CellsCollection) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns Uses the buffer handle to determine the Unique Index fields, uses an UltraGrid's cell collection (i.e. of an UltraGridRow) to access the values
+ CHARACTER UniqueFindPredicate (handle, CellsCollection, UltraGridRow, logical) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns Uses the buffer handle to determine the Unique Index fields, uses an UltraGrid's cell collection (i.e. of an UltraGridRow) to access the field/cell values
+ CHARACTER UniqueFindPredicate (handle, CellsCollection, logical) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns Uses the buffer handle to determine the Unique Index fields, uses an UltraGrid's cell collection (i.e. of an UltraGridRow) to access the field/cell values
+ CHARACTER UniqueFindPredicate (handle, CellsCollection, logical, logical) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns Uses the buffer handle to determine the Unique Index fields, uses an UltraGrid's cell collection (i.e. of an UltraGridRow) to access the field/cell values
+ CHARACTER UniqueFindPredicate (handle, logical) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns
+ CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, character) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns
+ CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, CharacterDictionary, character) Builds a QueryString predicate that can be used to (re)fetch a record based on equality of primary unique columns
+ CHARACTER UniqueKeyFields (character) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueKeyFields (character, logical) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueKeyFields (character, logical, logical) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueKeyFields (handle) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueKeyFields (handle, logical) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueKeyFields (handle, logical, logical) Returns the fields of the Unique Primary of the table
+ CHARACTER UniqueRecordIdentifier (handle) Builds and returns a unique record identifier composed from field values of either the primary unique index or the first unqiue index of the table
+ CHARACTER UniqueRecordIdentifier (handle, logical, character) Builds and returns a unique record identifier composed from field values of either the primary unique index or the first unqiue index of the table
+ CHARACTER UnqualifiedTableNames (character) Returns a list of unqualified table names by removing the database prefix
+ UpdateBufferFieldValues (handle, CharacterList, CharacterList) Updates fields of the provided buffer based on a CharacterList for the Field Names and a CharacterList for the field values
+ UpdateDeletedBeforeBufferFieldValues (handle, CharacterList, CharacterList) Updates the BEFORE-BUFFER of a ProDataset temp-table buffer with ROW-STATE = ROW-DELETED

Top Constructor Summary
Options Name Purpose
# BufferHelper () Protected default constructor.


Method Detail
Top

PUBLIC AddBufferFieldsToList (handle, ListNameValuePair, logical)

Purpose: Adds the fields from the given Buffer Handle to the given ListNameValuePair
Notes: Raises an error, when no record is available in the Buffer Handle
Does not add BLOB fields

Parameters:
phBuffer HANDLE
Then HANDLE of the Buffer that holds the record to log
poList Consultingwerk.ListNameValuePair
The reference to an instance of the ListNameValuePair class
plPrefixWithBuffer LOGICAL
Logical value indicating if field names should be prefixed with the table name
Top

PUBLIC CHARACTER AllFieldNames (handle)

Purpose: Returns a comma-delimited list of the buffer column names
Notes:

Parameters:
phBuffer HANDLE
The buffer handle
Returns CHARACTER
The comma-delimited list of the buffer's column names
Top

PUBLIC CHARACTER AllFieldsFindPredicate (handle)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of all fields

Parameters:
phBuffer HANDLE
The handle of the buffer
Returns CHARACTER
The QueryString predicate
Top

PUBLIC AssignFieldValue (handle, character, character)

Purpose: Assigns a Buffer Field Value from a character value
Notes:

Parameters:
phBuffer HANDLE
The buffer handle
pcFieldName CHARACTER
The buffer field name
pcValue CHARACTER
The character value
Top

PUBLIC CHARACTER BufferCompare (handle, handle)

Purpose: Compare to records field by field and returns
the list of different fields, performs case-sensitive comparison of
character and clob fields
Notes: Only processes fields that are on both buffers

Parameters:
phBuffer1 HANDLE
The handle of the first buffer
phBuffer2 HANDLE
The handle of the second buffer
Returns CHARACTER
Comma delimited list of field names with differences
Top

PUBLIC CHARACTER BufferFieldSubstitute (handle, character, character)

Purpose: Returns the result of a SUBSTITUTE function based on fields of a
buffer handle
Notes: Defaults to use the STRING-VALUE, not the BUFFER-VALUE

Parameters:
phBuffer HANDLE
The Buffer handle that contains the fields
pcFields CHARACTER
The comma delimited list of the fields
pcSubstitute CHARACTER
The pattern for the SUBSTITUTE function
Returns CHARACTER
The resulting string
Top

PUBLIC CHARACTER BufferFieldSubstitute (handle, character, character, logical)

Purpose: Returns the result of a SUBSTITUTE function based on fields of a
buffer handle
Notes: Does not support more than 9 entries

Parameters:
phBuffer HANDLE
The Buffer handle that contains the fields
pcFields CHARACTER
The comma delimited list of the fields
pcSubstitute CHARACTER
The pattern for the SUBSTITUTE function
plUseStringValue LOGICAL
True to use the STRING-VALUE, false to use the BUFFER-VALUE
Returns CHARACTER
The resulting string
Top

PUBLIC CHARACTER BufferFieldSubstitute (handle, character, character, logical, ListNameValuePair)

Purpose: Returns the result of a SUBSTITUTE function based on fields of a
buffer handle
Notes: Does not support more than 9 entries

Parameters:
phBuffer HANDLE
The Buffer handle that contains the fields
pcFields CHARACTER
The comma delimited list of the fields
pcSubstitute CHARACTER
The pattern for the SUBSTITUTE function
plUseStringValue LOGICAL
True to use the STRING-VALUE, false to use the BUFFER-VALUE
poMissingFields Consultingwerk.ListNameValuePair
The ListNameValuePair with the optional values in case the buffer does not have a requested field
Returns CHARACTER
The resulting string
Top

PUBLIC CHARACTER BufferFieldSubstituteFormatted (handle, character, character, character)

Purpose: Returns the result of a SUBSTITUTE function based on formatted fields of a
buffer handle
Notes: Does not support more than 9 entries

Parameters:
phBuffer HANDLE
The Buffer handle that contains the fields
pcFields CHARACTER
The comma delimited list of the fields
pcSubstitute CHARACTER
The pattern for the SUBSTITUTE function
pcFormats CHARACTER
The formats to apply to the fields, delimited by the Tilde
Returns CHARACTER
The resulting string
Top

PUBLIC CHARACTER BufferFieldValue (handle)

Purpose: Returns a character representation of a buffer field value
Notes: Tries to return the formatted STRING-VALUE. If the actual value
is not complient with the fields format, it returns
STRING(BUFFER-VALUE)

Parameters:
phField HANDLE
The handle of the buffer field
Returns CHARACTER
The character representation of the buffer field value
Top

PUBLIC HANDLE BufferHandle (BufferFieldName)

Purpose: Returns the handle to the database buffer referenced by the
BufferFieldName object
Notes: The caller is expected to delete the buffer object handle when it's
no longer needed

Parameters:
poBufferFieldName Consultingwerk.BufferFieldName
The reference to the BufferFieldName object
Returns HANDLE
The handle to the buffer references by the BufferFieldName object
Top

PUBLIC CHARACTER BufferIndexByClause (handle, character, logical)

Purpose: Returns the by clause mathing a buffer index
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
pcIndexName CHARACTER
The name of the index
plIncludeBuffer LOGICAL
Include buffer name in by clause
Returns CHARACTER
The by clause mathing the index sort
Top

PUBLIC CHARACTER BufferIndexByClause (handle, character, logical, logical)

Purpose: Returns the by clause matching a buffer index
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
pcIndexName CHARACTER
The name of the index
plIncludeBuffer LOGICAL
Include buffer name in by clause
plReverseOrder LOGICAL
Return reverse sort order (ASCENDING -> DESCENDING, DESCENDING -> ASCENDING)
Returns CHARACTER
The by clause mathing the index sort
Top

PUBLIC CHARACTER BufferIndexFields (handle, character)

Purpose: Returns the list of fields referenced in an index
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
pcIndexName CHARACTER
The name of the index
Returns CHARACTER
The comma delimited list of index fields
Top

PUBLIC CHARACTER BufferLargeColumns (handle)

Purpose: Returns the large columns from the given buffer handle
Notes: Used by QueryHelper:QueryLargeColumns

Parameters:
phBuffer HANDLE
The handle of the Buffer
Returns CHARACTER
The comma delimited list of large column names
Top

PUBLIC CHARACTER BufferPrimaryIndexByClause (handle, logical)

Purpose: Returns the by clause matching a buffers primary index
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
plIncludeBuffer LOGICAL
Include buffer name in by clause
Returns CHARACTER
The by clause mathing the index sort
Top

PUBLIC CHARACTER BufferQueryString (character, character, character)

Purpose: Returns a query string for the given buffer based on
a list of key fields and values
Notes:

Parameters:
pcBufferName CHARACTER
The name of the buffer
pcKeyFields CHARACTER
The comma delimited list of key fields
pcQueryValues CHARACTER
The delimited list of query values
Returns CHARACTER
The query string
Top

PUBLIC CHARACTER BufferQueryString (character, character, character, character)

Purpose: Returns a query string for the given buffer based on
a list of key fields and values
Notes:

Parameters:
pcBufferName CHARACTER
The name of the buffer
pcKeyFields CHARACTER
The comma delimited list of key fields
pcQueryValues CHARACTER
The delimited list of query values
pcDelimiter CHARACTER
The delimiter for the query values
Returns CHARACTER
The query string
Top

PUBLIC Consultingwerk.BufferTypeEnum BufferType (handle)

Purpose: Determines the type of a Buffer
Notes: Database, Temp-Table or Before-Table

Parameters:
phBuffer HANDLE
The buffer to determine the type of
Returns Consultingwerk.BufferTypeEnum
The type of the Buffer as a BufferTypeEnum value
Top

PUBLIC LOGICAL CanCreateDefaultRow (handle)

Purpose: Validates that a record can be created using the default values
Notes: Checks if there is already a record matching the fields in the
Unique Indexes

Parameters:
phBuffer HANDLE
The buffer handle
Returns LOGICAL
Logical value indicating if a record with default values can be created
Top

PUBLIC CHARACTER ConcatenateFieldValues (handle, character, character)

Purpose: Concatenates the values of the given buffer fields
Notes: Alternative to the BufferFieldSubstitute method when more
than 9 field values are required

Parameters:
phBuffer HANDLE
The handle of the buffer
pcFields CHARACTER
The comma delimited list of fields
pcDelimiter CHARACTER
The delimiter to use
Returns CHARACTER
The concatenated field values
Top

PUBLIC LOGICAL CopyErrorStatus (handle, handle)

Purpose: Copies the error-status from the source buffer to the target buffer
Notes: Also sets the buffer's Dataset's error attribute on the target buffer

Parameters:
phFromBuffer HANDLE
The handle of the source Buffer
phToBuffer HANDLE
The handle of the target Buffer
Returns LOGICAL
Logical value indicating if the target dataset has the error attribute set
Top

PUBLIC HANDLE CreateBuffer (BufferFieldName)

Purpose: Creates and returns a dynamic buffer based on a BufferFieldName object
Notes: The caller is expected to delete the buffer object handle when it's
no longer needed

Parameters:
poBufferFieldName Consultingwerk.BufferFieldName
The BufferFieldName reference
Returns HANDLE
The handle of the dynamic buffer
Top

PUBLIC HANDLE CreateBuffer (handle)

Purpose: Creates a Dynamic buffer on the fly
Notes: Useful to pass a new buffer handle without the need to define a
variable upfront (e.g. ProDataset:ADD-BUFFER, etc.)

Parameters:
phTable HANDLE
The handle of the table or existing buffer which can specify the source for which to create the buffer object
Returns HANDLE
The handle of the new dynamic buffer
Top

PUBLIC HANDLE CreateTempTableFromRecord (handle)

Purpose: Creates a temp-table with the current record of the provided
buffer
Notes: When the buffer does not have a record available, an empty temp-table
is created

Parameters:
phBuffer HANDLE
The handle of the source buffer
Returns HANDLE
The handle of the created temp-table
Top

PUBLIC HANDLE CreateTempTableFromRecord (handle, character)

Purpose: Creates a temp-table with the current record of the provided
buffer
Notes: When the buffer does not have a record available, an empty temp-table
is created

Parameters:
phBuffer HANDLE
The handle of the source buffer
pcFieldNames CHARACTER
The comma delimited list of field names to create (CAN-DO like, or ? for all fields)
Returns HANDLE
The handle of the created temp-table
Top

PUBLIC CHARACTER FieldSerializeName (handle)

Purpose: Returns a buffer fields SERIALIZE-NAME when set,
otherwise the fields NAME
Notes:

Parameters:
phField HANDLE
The handle of a temp-table field
Returns CHARACTER
The fields SERIALIZE-NAME or NAME
Top

PUBLIC CHARACTER FieldValueList (handle, character)

Purpose: Returns a delimited list of field values
Notes: No support for array extents

Parameters:
phBuffer HANDLE
The handle of the buffer
pcFieldNames CHARACTER
The list of field names
Returns CHARACTER
The delimited list of field values
Top

PUBLIC CHARACTER FieldValueList (handle, character, character)

Purpose: Returns a delimited list of field values
Notes: No support for array extents

Parameters:
phBuffer HANDLE
The handle of the buffer
pcFieldNames CHARACTER
The list of field names
pcDelimiter CHARACTER
The list delimiter
Returns CHARACTER
The delimited list of field values
Top

PUBLIC CHARACTER FieldWithSerializeName (handle, character)

Purpose: Returns the name of the buffer field with the
given SERIALIZE-NAME
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
pcSerializeName CHARACTER
The serialize name of the field to return
Returns CHARACTER
The field name or ? when the field could not be found
Top

PUBLIC FindAfterBuffer (handle)

Purpose: Finds the before buffer's after-buffer record
Notes:

Parameters:
phBeforeBuffer HANDLE
The handle of the before buffer
Top

PUBLIC FindBeforeBuffer (handle)

Purpose: Finds the after buffer's before-buffer record
Notes:

Parameters:
phAfterBuffer HANDLE
The handle of the after buffer
Top

PUBLIC FindDatabaseBuffer (handle, handle, character)

Purpose: Finds the database record for a linked (ProDataset data-source) record
in a ProDataset.
Notes: Uses the PUK or first UK of the database record with the field values
of the ProDataset buffer, based on the provided field mapping.
Defaults to SHARE-LOCK

Parameters:
phBuffer HANDLE
The database buffer to locate
phDatasetBuffer HANDLE
The dataset (before or after) buffer
pcFieldMapping CHARACTER
The field mapping between database and temp-table (ATTACH-DATA-SOURCE method)
Top

PUBLIC FindDatabaseBuffer (handle, handle, character, LockModeEnum)

Purpose: Finds the database record for a linked (ProDataset data-source) record
in a ProDataset.
Notes: Uses the PUK or first UK of the database record with the field values
of the ProDataset buffer, based on the provided field mapping

Parameters:
phBuffer HANDLE
The database buffer to locate
phDatasetBuffer HANDLE
The dataset (before or after) buffer
pcFieldMapping CHARACTER
The field mapping between database and temp-table (ATTACH-DATA-SOURCE method)
poLockMode Consultingwerk.Util.Enum.LockModeEnum
The LockModeEnum value controlling the record lock-mode
Top

PUBLIC GetFieldNameAndExtent (character, character, integer)

Purpose: Returns the name and extent of the field name
Notes:

Parameters:
pcField CHARACTER
The field name, including extent if present
pcFieldName CHARACTER
OUTPUT Just the field name portion
piExtent INTEGER
OUTPUT The field extent or 0 when the field name did not contain extent information
Top

PUBLIC Consultingwerk.Framework.Collections.CharacterDictionary GetFieldValues (handle, character)

Purpose: Returns a dictionary with field values of the given buffer
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
pcFieldNames CHARACTER
The comma delimited list of field names to return the values for
Returns Consultingwerk.Framework.Collections.CharacterDictionary
The CharcaterDictionary with the field values
Top

PUBLIC LOGICAL HasChanges (handle, character)

Purpose: Returns if the provided ProDataste temp-table buffer handle
has changes in the provided field list
Notes:

Parameters:
phBufferHandle HANDLE
The handle of the temp-table buffer
pcFields CHARACTER
The comma delimited list of field names
Returns LOGICAL
Logical value indicating if the fields have changes
Top

PUBLIC LOGICAL HasField (handle, character)

Purpose: Tests if the passed in buffer handle has a field with the
given name
Notes: Verifies that a valid buffer is passed in first.

Parameters:
phBuffer HANDLE
The Buffer handle to test
pcFieldName CHARACTER
The name of the buffer field
Returns LOGICAL
Logical value indicating if the field exists
Top

PUBLIC LOGICAL HasFields (handle, character)

Purpose: Tests if the passed in buffer handle has all fields with the
given names
Notes: Verifies that a valid buffer is passed in first.

Parameters:
phBuffer HANDLE
The Buffer handle to test
pcFieldNames CHARACTER
The names of the buffer fields
Returns LOGICAL
Logical value indicating if the fields exists
Top

PUBLIC LOGICAL IsDatabaseBuffer (handle)

Purpose: Returns TRUE when the passed in Buffer Handle is a buffer handle for
a database table
Notes:

Parameters:
phBuffer HANDLE
The buffer handle to test
Returns LOGICAL
Logical value indicating if the buffer handle is for a database buffer
Top

PUBLIC LOGICAL IsUniqueFieldCombination (handle, character)

Purpose: Returns if the provided list of field names is unqiue
Notes: Tests if there is an unique index defined for the buffer
where all index fields are contained in the list of fields
Base for the DatasetHelper:IsUniqueChildRelation method

Parameters:
phBuffer HANDLE
The handle of the Buffer (database or temp-table) to test for
pcFields CHARACTER
The comma delimited list of fields to test for
Returns LOGICAL
Logical value indicating if the provided field combination satisfies a unique index
Top

PUBLIC CHARACTER NewGuidWhenEmpty (handle, character)

Purpose: Assigns a new GUID value to a buffer field when the buffer field is
empty or ?
Notes: Useful in a Data Access class, to conditionally assign a GUID when
the client might or might not have done so yet

Parameters:
phBuffer HANDLE
The Buffer handle
pcFieldName CHARACTER
The name of the buffer field (type CHARACTER)
Returns CHARACTER
The GUID value (either existing in the buffer field or the new value)
Top

PUBLIC NullifyUniqueIndexFields (handle)

Purpose: Nullify (?) all unique index field values
Notes: This methods can be used when creating records, but there is already
a record in the table, that uses the default values of some index fields

Parameters:
phBuffer HANDLE
The buffer handle
Top

PUBLIC INT64 NumRecords (character)

Purpose: Returns the number of records available in the table
Notes:

Parameters:
pcTableName CHARACTER
The name of the database table
Returns INT64
The number of records available in the buffer
Top

PUBLIC INTEGER NumRecords (handle)

Purpose: Returns the number of records available in the Buffer
Notes:

Parameters:
phBuffer HANDLE
The buffer handle
Returns INTEGER
The number of records available in the buffer
Top

PUBLIC Consultingwerk.BufferFieldName ParseFieldName (character)

Purpose: Parses a field name
Notes: Supports db.table.field, table.field, field with and without index (extent)

Parameters:
pcFieldName CHARACTER
The field name to parse
Returns Consultingwerk.BufferFieldName
The Consultingwerk.BufferFieldName struct describing the field name
Top

PUBLIC ParseSaxAttributesToBuffer (handle, handle)

Purpose: Assigns buffer field values from SAX-ATTRIBUTES
Notes: Defaults to fail on unknown fields

Parameters:
phBuffer HANDLE
The handle to the buffer to assign the field values to
phSaxAttributes HANDLE
The handle of the SAX-ATTRIBUTES widget
Top

PUBLIC ParseSaxAttributesToBuffer (handle, handle, logical)

Purpose: Assigns buffer field values from SAX-ATTRIBUTES
Notes:

Parameters:
phBuffer HANDLE
The handle to the buffer to assign the field values to
phSaxAttributes HANDLE
The handle of the SAX-ATTRIBUTES widget
plFailOnUnknownFields LOGICAL
Logical value indicating if the routine should fail on unknown field names
Top

PUBLIC CHARACTER QualifiedFieldName (handle)

Purpose: Returns the qualified field name of a buffer field
Notes: Returns buffername.fieldname

Parameters:
phBufferField HANDLE
The handle of the buffer field
Returns CHARACTER
The qualified field name
Top

PUBLIC CHARACTER QualifiedTableName (handle)

Purpose: Returns the qualified table name of a buffer
Notes: For a DB buffer the qualified table name is prefixed with the database name
For a temp-table buffer the qualified table name is the same as the temp-table name

Parameters:
phBuffer HANDLE
The handle of the buffer
Returns CHARACTER
The qualified table name
Top

PUBLIC ResetToInitialValueExcept (handle, character)

Purpose: Resets all fields of a buffer to their inital value, except the given
list of fields
Notes: Typically the list of except fields are a records PUK fields

Parameters:
phBuffer HANDLE
The handle of the buffer
pcExceptFields CHARACTER
The comma delimited list of fields not to reset
Top

PUBLIC ShowBuffer (handle)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: Defaults to show the first 15 fields, throws error on invalid buffer handle

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
Top

PUBLIC ShowBuffer (handle, character)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: Defaults to show the first 15 fields, throws error on invalid buffer handle

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
pcMessageText CHARACTER
An additional message text to show before the buffer contents
Top

PUBLIC ShowBuffer (handle, integer)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: When number of fields is 0 all fields will be shown, throws error on invalid buffer handle

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
piNumFields INTEGER
The maximum number of fields to show
Top

PUBLIC ShowBuffer (handle, integer, character)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: When number of fields is 0 all fields will be shown, throws error on invalid buffer handle

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
piNumFields INTEGER
The maximum number of fields to show
pcMessageText CHARACTER
An additional message text to show before the buffer contents
Top

PUBLIC ShowBuffer (handle, integer, logical)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: When number of fields is 0 all fields will be shown

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
piNumFields INTEGER
The maximum number of fields to show
plThrowOnInvalidHandle LOGICAL
Logical value indicating if the method should throw an error on an invalid widget handle
Top

PUBLIC ShowBuffer (handle, integer, logical, character)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: When number of fields is 0 all fields will be shown

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
piNumFields INTEGER
The maximum number of fields to show
plThrowOnInvalidHandle LOGICAL
Logical value indicating if the method should throw an error on an invalid widget handle
pcMessageText CHARACTER
An additional message text to show before the buffer contents
Top

PUBLIC ShowBuffer (handle, logical)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: Defaults to show the first 15 fields

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
plThrowOnInvalidHandle LOGICAL
Logical value indicating if the method should throw an error on an invalid widget handle
Top

PUBLIC ShowBuffer (handle, logical, character)

Purpose: Shows buffer field values on the screen using the MESSAGE statement
Notes: Defaults to show the first 15 fields

Parameters:
phBuffer HANDLE
The handle of the Buffer to output
plThrowOnInvalidHandle LOGICAL
Logical value indicating if the method should throw an error on an invalid widget handle
pcMessageText CHARACTER
An additional message text to show before the buffer contents
Top

PUBLIC CHARACTER SourceBufferMapping (handle, character)

Purpose: Returns the DATA-SOURCE field mapping for the given source buffer
Notes: Filters the buffer's DATA-SOURCE-COMPLETE-MAP by the source buffer
name entries

Parameters:
phBuffer HANDLE
The ProDataset temp-table buffer
pcSourceBufferName CHARACTER
The name of the source buffer (typically database buffer)
Returns CHARACTER
CHARACTER
Top

PUBLIC CHARACTER ToBufferNameFieldName (character)

Purpose: Converts a field name specified as either db.table.field or buffer.field
to buffer.field
Notes:

Parameters:
pcFieldName CHARACTER
The original field reference
Returns CHARACTER
The normalized field reference
Top

PUBLIC INTEGER TotalNumberOfFields (handle)

Purpose: Returns the total number of fields in a Buffer including Array
fields as individual columns
Notes:

Parameters:
phBuffer HANDLE
The handle to the buffer
Returns INTEGER
The total number of columns, including array extents
Top

PUBLIC CHARACTER UniqueFindPredicate (handle)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The handle of the buffer
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, character)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The handle of the buffer
pcBufferName CHARACTER
The Buffer name to prefix fields with, leave empty to not apply the fields with a buffer name
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, CellsCollection)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Uses the buffer handle to determine the Unique Index fields, uses
an UltraGrid's cell collection (i.e. of an UltraGridRow) to access
the values
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The Handle to the buffer to return the FIND predicate for
poCells Infragistics.Win.UltraWinGrid.CellsCollection
The reference to the Cells collection (of an UltraGridRow) that contains the values
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, CellsCollection, UltraGridRow, logical)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Uses the buffer handle to determine the Unique Index fields, uses
an UltraGrid's cell collection (i.e. of an UltraGridRow) to access
the field/cell values
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The Handle to the buffer to return the FIND predicate for
poCells Infragistics.Win.UltraWinGrid.CellsCollection
The reference to the Cells collection (of an UltraGridRow) that contains the values
poRow Infragistics.Win.UltraWinGrid.UltraGridRow
Not used, ignored
plIncludeBufferName LOGICAL
Logical value indicating if the FIND predicate should be fully quallified including buffer names
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, CellsCollection, logical)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Uses the buffer handle to determine the Unique Index fields, uses
an UltraGrid's cell collection (i.e. of an UltraGridRow) to access
the field/cell values
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The Handle to the buffer to return the FIND predicate for
poCells Infragistics.Win.UltraWinGrid.CellsCollection
The reference to the Cells collection (of an UltraGridRow) that contains the values
plIncludeBufferName LOGICAL
Logical value indicating if the FIND predicate should be fully quallified including buffer names
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, CellsCollection, logical, logical)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Uses the buffer handle to determine the Unique Index fields, uses
an UltraGrid's cell collection (i.e. of an UltraGridRow) to access
the field/cell values
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The Handle to the buffer to return the FIND predicate for
poCells Infragistics.Win.UltraWinGrid.CellsCollection
The reference to the Cells collection (of an UltraGridRow) that contains the values
plIncludeBufferName LOGICAL
Logical value indicating if the FIND predicate should be fully quallified including buffer names
plUseFullFieldNames LOGICAL
Logical value indicating if the ProBindingSource is using the UseFullFieldNames feature
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicate (handle, logical)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The handle of the buffer
plIncludeBufferName LOGICAL
Logical value indicating if the buffer name should be included in the field names
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, character)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The handle of the buffer
phValueBuffer HANDLE
The buffer to access field values from
pcBufferName CHARACTER
The Buffer name to prefix fields with, leave empty to not apply the fields with a buffer name
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, CharacterDictionary, character)

Purpose: Builds a QueryString predicate that can be used to (re)fetch a
record based on equality of primary unique columns
Notes: Returns "" when there is no primary unique index.

Parameters:
phBuffer HANDLE
The handle of the buffer
phValueBuffer HANDLE
The buffer to access field values from
poMissingValues Consultingwerk.Framework.Collections.CharacterDictionary
The dictionary of character values for index fields from the phBuffer not present in phValueBuffer
pcBufferName CHARACTER
The Buffer name to prefix fields with, leave empty to not apply the fields with a buffer name
Returns CHARACTER
The query string predicate
Top

PUBLIC CHARACTER UniqueKeyFields (character)

Purpose: Returns the fields of the Unique Primary of the table
Notes: Same as UniqueKeyFields (pcBufferName, TRUE, FALSE)

Parameters:
pcBufferName CHARACTER
The name of the database table
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueKeyFields (character, logical)

Purpose: Returns the fields of the Unique Primary of the table
Notes: Same as UniqueKeyFields (pcBufferName, plPrimaryOnly, FALSE)

Parameters:
pcBufferName CHARACTER
The name of the database table
plPrimaryOnly LOGICAL
Only return the fields of a primary unique index
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueKeyFields (character, logical, logical)

Purpose: Returns the fields of the Unique Primary of the table
Notes:

Parameters:
pcBufferName CHARACTER
The name of the database table
plPrimaryOnly LOGICAL
Only return the fields of a primary unique index
plPrefixWithTable LOGICAL
Prefix field names with Table/Buffer name
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueKeyFields (handle)

Purpose: Returns the fields of the Unique Primary of the table
Notes: Same as UniqueKeyFields (phBuffer, TRUE, FALSE)

Parameters:
phBuffer HANDLE
The Buffer Handle
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueKeyFields (handle, logical)

Purpose: Returns the fields of the Unique Primary of the table
Notes: Same as UniqueKeyFields (phBuffer, plPrimaryOnly, FALSE)

Parameters:
phBuffer HANDLE
The Buffer Handle
plPrimaryOnly LOGICAL
Only return the fields of a primary unique index
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueKeyFields (handle, logical, logical)

Purpose: Returns the fields of the Unique Primary of the table
Notes:

Parameters:
phBuffer HANDLE
The Buffer Handle
plPrimaryOnly LOGICAL
Only return the fields of a primary unique index
plPrefixWithTable LOGICAL
Prefix field names with Table/Buffer name
Returns CHARACTER
The a comma-delimited list of the unique fields of the table
Top

PUBLIC CHARACTER UniqueRecordIdentifier (handle)

Purpose: Builds and returns a unique record identifier composed from field
values of either the primary unique index or the first unqiue index
of the table
Notes: Calls UniqueRecordIdentifier (phBuffer, TRUE, CHR(1))

Parameters:
phBuffer HANDLE
The handle of the buffer that contains the record
Returns CHARACTER
An identifier for the records based on unique index values
Top

PUBLIC CHARACTER UniqueRecordIdentifier (handle, logical, character)

Purpose: Builds and returns a unique record identifier composed from field
values of either the primary unique index or the first unqiue index
of the table
Notes: The purpose of this method is to build a unique reusable identifier
for a record that is not dependent on a ROWID (temp-table ROWID's are
no suited record identifiers)

Parameters:
phBuffer HANDLE
The handle of the buffer that contains the record
plPrimaryOnly LOGICAL
Logical value indicating if only the primary index should be used
pcDelimiter CHARACTER
The delimiter to use for the field values
Returns CHARACTER
An identifier for the records based on unique index values
Top

PUBLIC CHARACTER UnqualifiedTableNames (character)

Purpose: Returns a list of unqualified table names by removing the database prefix
Notes:

Parameters:
pcQualifiedTableNames CHARACTER
A comma delimited list of potentially DB qualified table names
Returns CHARACTER
The list of unqualified table names by removing the database prefix
Top

PUBLIC UpdateBufferFieldValues (handle, CharacterList, CharacterList)

Purpose: Updates fields of the provided buffer based on a
CharacterList for the Field Names and a CharacterList
for the field values
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer
poFieldNames Consultingwerk.Framework.Collections.CharacterList
The CharacterList with the field names
poValues Consultingwerk.Framework.Collections.CharacterList
The CharacterList with the field values
Top

PUBLIC UpdateDeletedBeforeBufferFieldValues (handle, CharacterList, CharacterList)

Purpose: Updates the BEFORE-BUFFER of a ProDataset temp-table
buffer with ROW-STATE = ROW-DELETED
Notes: Used to return (updated) field values with the BEFORE-BUFFER
of a delete operation. This routine temporarily rejects the
deleted record and deletes it again. So it may cause unique
key conflicts when within a ProDataset temp-table a record
was deleted and another pending created (or updated) record
is using the same key values

Parameters:
phBuffer HANDLE
The handle of the buffer
poFieldNames Consultingwerk.Framework.Collections.CharacterList
The CharacterList with the field names
poValues Consultingwerk.Framework.Collections.CharacterList
The CharacterList with the field values


Constructor Detail
Top

PROTECTED BufferHelper ()

Purpose: Protected default constructor.
Notes: There's no need to create instances of the helper classes



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