Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The meaning of the response value depends on the service.

Parameters

ParameterDescription
Service
@ServiceThe name of the service being requested. Required.
Param1 - Param10
@ParamsGeneric parameters. Refer to a specific service to determine the actual parameters used.

Remarks

This module provides several useful services for high level interaction with database tables and rows.

Services

ServiceDescription
VerifyLHAll

CalculateColumn

Usage:
Database_Services('

VerifyLHAll

CalculateColumn'

, ErrorMessage

)

Comments:

Sets an error to the stack. This will automatically clear any existing error conditions first so this error will be the only one on the stack

Called directly from within a calculation column. The name of the table and column is derived from the call stack and the associated table commuter, if it exists, is called with the appropriate arguments.

Returns:

N/A 

The result of the calculated column.

ClearTableHandle

VerifyLH

Usage:
Database_Services('

VerifyLH

ClearTableHandle',

ErrorMessage

TableName)

Comments:

Adds an error to the stack. This will not clear existing error conditions first. It is intended to allow higher level routines to add more information to an existing error condition or simply to maintain an ongoing error log for some troubleshooting or debugging purposes

Clears the table handle array array from cache. This will force the GetTableHandle service to call the Open statement again.

Returns:
N/A

GetTableProperties

DeleteDataRow

Usage:
Database_Services('

GetTableProperties'

DeleteDataRow', TableName, KeyID, IgnoreSelfLock, IgnoreMFSRoutines)

Comments:

Clears all error conditions and related information

Deletes a data row for the indicated Key ID and database table.

Returns:
N/A

GetTableHandle

GetKeyIDLock

Usage:
Database_Services('

GetTableHandle'

GetKeyIDLock', TableName, KeyID, IgnoreSelfLock)

Comments:

Returns the most current error message

Attempts to perform a semaphore lock on the indicated tablename and Key ID.

Returns:

The most current error message.ClearTableHandle

A Boolean flag indicating if the lock request was successfully performed.

GetTableCommuter

Usage:
Database_Services('

ClearTableHandle

GetTableCommuter', TableName)

Comments:
Returns the

stack of error messages. This will be @FM delimited

name of the indicated table's commuter module if it exists. If it does not exist then an empty string will be returned.

Returns:

The stack of error messages

See comments.

ReadDataRow

GetTableHandle

Usage:
Database_Services('

ReadDataRow

If Error_Services('HasError') then
* An error has occured. Proceed accordingly.
ErrorMessage = Error_Services('GetMessage')
end else
* No error has occured.
end

Returns:
True if there is an error condition, False if there is no error condition.

WriteDataRow

GetTableHandle', TableName)

Comments:
Returns

True if there is an error condition, False if there is no error condition. Caller will still need to use the GetMessage or GetMessages service to determine what the error is. The HasError service allows the caller to embed the Error_Services service call inside of a conditional statement like this:

an @FM list of currently attached OpenInsight database tables.

Returns:
The handle array created by the Open statement.

GetTableNames

Usage:
Database_Services('GetTableNames', ApplicationTablesOnly, ExcludeDictionaries, ExcludeIndexes)

Comments:
Returns an array of information related to the database table being passed in.

Returns:
See comments.

GetTableProperties

Usage:
Database_Services('

WriteDataRow

GetTableProperties', TableName)

Comments:
Returns

True if there are no error conditions, False if there is an error condition. This is the opposite of the HasError service and exists for improved readability.

an array of information related to the database table being passed in.

Returns:
An @FM delimited array of table information:

AttributeDescription
<1>Database ID
<2>MFS/BFS list
<3>Volume Label (if available)
<4>Volume Path (if available)
<5>BFS (if available)


GetUserLocks

Returns:
True if there are no error conditions, False if there is an error condition.

DeleteDataRow

Usage:
Database_Services('

DeleteDataRow

GetUserLocks')

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Note, this can only be done with the UD 5. This can also cause instability with the current session and may require the Task Manager to close the session.

Returns:
Returns a dynamic array of user lock information.

IsKeyIDLocked

Returns:
N/A

GetKeyIDLock

Usage:
Database_Services('

GetKeyIDLock'

IsKeyIDLocked', TableName, KeyID, IgnoreSelfLock)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock

Returns a Boolean flag of the lock status for the indicated table and Key ID.

Returns:

N/AReleaseKeyIDLock

See comments.

IsKeyIDSelfLocked

Usage:
Database_Services('

ReleaseKeyIDLock

IsKeyIDSelfLocked', TableName, KeyID)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Returns a Boolean flag of the self-lock status for the indicated table and Key ID.

Returns:
See comments

ReadDataRow

Returns:
N/A

SetTableAlias

Usage:
Database_Services('

SetTableAlias'

ReadDataRow', KeyID, NotExpired, ExpirationDuration, IgnoreMFSRoutines)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Reads a data row for the indicated Key ID and database table.

Returns:
The requested data row.

ReleaseKeyIDLock

Returns:
N/A

SearchIndex

Usage:
Database_Services('

SearchIndex

ReleaseKeyIDLock', TableName, KeyID)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock

Attempts to release a semaphore lock on the indicated tablename and Key ID.

Returns:

N/ACalculateColumn

A Boolean flag indicating if the lock release was successfully performed.

SearchIndex

Usage:
Database_Services('

CalculateColumn'

SearchIndex', TableName, ColumnName, SearchValue, UpdateIndex)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Returns an @FM delimited list of Key IDs that match the search value.

Returns:
See comments

SetTableAlias

Returns:
N/A

GetTableCommuter

Usage:
Database_Services('

GetTableCommuter'

SetTableAlias', TableName, AliasName, Volume, DatabaseID)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock

Attempts to create an alias for the indicated table, volume, and database. It returns a True$ if successful or a False$ if unsuccessful.

Returns:

N/AGetUserLocks

A Boolean flag indicating if the alias request was successfully performed.

UnlockKeyID

Usage:
Database_Services('

GetUserLocks

UnlockKeyID', TableName, KeyID)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock

Attempts to unlock the indicated Key ID from the indicated Table Name. Note, this can only be done with the UD 5.

Returns:

N/AIsKeyIDLocked

A Boolean flag indicating if the unlock request was successfully performed.

VerifyLH

Usage:
Database_Services('

IsKeyIDLocked

Returns:
N/A

IsKeyIDSelfLocked

VerifyLH', Tablenames, SaveList)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Performs a health check against the indicated tables and returns back any issues. Note: This uses the Verify_LH subroutine to check for GFEs. All results are stored in the SYSLHVERIFY table with a KeyID of VolumeLabel*DatabaseID*TableName. Returns the list of groups that have GFEs or returns an empty string if there are none. The list of GFEs or empty strings will themselves be @FM delimited to correspond with the tables passed into this service.

Returns:
An @FM delimited array of table names and associated GFE information.

VerifyLHAll

Usage:
Database_Services('

IsKeyIDSelfLocked

VerifyLHAll')

Comments

:
Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

:
Performs a health check against all attached tables and returns back any issues.

Returns:
Returns two lists which are delimited by an @RM. The first list is an @FM list of attached tables. The second list is an @FM list of results (groups that have GFEs or an empty string if there are none). Items in each list correspond which each other based on their list position.

WriteDataRow

Returns:
N/A

UnlockKeyID

Usage:
Database_Services('

UnlockKeyID'

WriteDataRow', TableName, KeyID, DataRow, IgnoreSelfLock, IgnoreMFSRoutines, IgnoreAllLocks)

Comments:

Displays the current error message to the end user. Error_Services is designed to avoid any user interface so it can be safe to use in application contexts where no presentation server context is available (e.g., web applications). For convenience, the DisplayError service was added to make it easy to display the most recent error added to the stock.

Writes a data row for the indicated Key ID and database table.

Returns:
N/A

...

Params

The proper use of the generic arguments are defined in the definition of each service above.

...