DatabaseFileBase class | QSYS API Reference Guide

Estimated reading time: 31 minutes

Common base class for Database data files, single format and multiformat. It contains methods common to both kinds.

Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll

Inheritance: Object –> FileBase

Constructors

Name Description
DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean) Initializes a new instance of the DatabaseFileBase class.
DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean, Action) Initializes a new instance of the DatabaseFileBase class.
DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean) Initializes a new instance of the DatabaseFileBase class.
DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean, Action) Initializes a new instance of the DatabaseFileBase class.

DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean)

Initializes a new instance of the DatabaseFileBase class.

DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean)

Parameters

Type Parameter name Description
String dclDiskFileName Field name for this file in the program.
String filePath Path to the file in the Database, given as “library/filename”.
String memberName The name of the file member. Default is “*FIRST”.
Int32 blockingFactor An integer that determines if and optionally how many database records will be blocked across the Network for better performance when reading or writing groups of records. Pass -1 for no blocking.
String shareType String value that selects the type of file sharing.
Boolean isFormatID True to check format ID.
Int32 waitRec An integer specifying the waiting period for a record.
String qrySelect Simple query select statement. Default is “*NONE”.
String qryKeyFlds Simple query search keys statement. Default is “*NONE”.
String qryFileName Simple query file name. Default is “*NAME”.
Boolean isDefaultRFN True to use the default renamed format.
Boolean isKeyed True if the file has a key.

DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean, Action)

Initializes a new instance of the DatabaseFileBase class.

DatabaseFileBase(String, String, String, Int32, String, Boolean, Int32, String, String, String, Boolean, Boolean, Action)

Parameters

Type Parameter name Description
String dclDiskFileName Field name for this file in the program.
String filePath Path to the file in the Database, given as “library/filename”.
String memberName The name of the file member. Default is “*FIRST”.
Int32 blockingFactor An integer that determines if and optionally how many database records will be blocked across the Network for better performance when reading or writing groups of records. Default is -1, which means no blocking.
String shareType String value that selects the type of file sharing.
Boolean isFormatID True to check format ID..
Int32 waitRec An integer specifying the waiting period for a record.
String qrySelect Simple query select statement. Default is “*NONE”.
String qryKeyFlds Simple query search keys statement. Default is “*NONE”.
String qryFileName Simple query file name. Default is “*NAME”.
Boolean isDefaultRFN DatabaseFileBase isDefaultRFN param.
Boolean isKeyed DatabaseFileBase isKeyed param.
Action infSR DatabaseFileBase infSR param.

DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean)

Initializes a new instance of the DatabaseFileBase class.

DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean)

Parameters

Type Parameter name Description
String dclDiskFileName Field name for this file in the program.
String filePath Path to the file in the Database, given as “library/filename”.
String memberName The name of the file member. Default is “*FIRST”.
Int32 blockingFactor An integer that determines if and optionally how many database records will be blocked across the Network for better performance when reading or writing groups of records. Pass -1 for no blocking.
ShareTypes shareType ShareTypes value that selects the type of file sharing.
Boolean isFormatID True to check format ID..
Int32 waitRec An integer specifying the waiting period for a record.
String qrySelect Simple query select statement. Default is “*NONE”.
String qryKeyFlds Simple query search keys statement. Default is “*NONE”.
String qryFileName Simple query file name. Default is “*NAME”.
Boolean isDefaultRFN True to use the default renamed format.
Boolean isKeyed True if the file has a key.

DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean, Action)

Initializes a new instance of the DatabaseFileBase class.

DatabaseFileBase(String, String, String, Int32, ShareTypes, Boolean, Int32, String, String, String, Boolean, Boolean, Action)

Parameters

Type Parameter name Description
String dclDiskFileName Field name for this file in the program.
String filePath Path to the file in the Database, given as “library/filename”.
String memberName The name of the file member. Default is “*FIRST”.
Int32 blockingFactor An integer that determines if and optionally how many database records will be blocked across the Network for better performance when reading or writing groups of records. Default is -1, which means no blocking.
ShareTypes shareType ShareTypes value that selects the type of file sharing.
Boolean isFormatID True to check format ID..
Int32 waitRec An integer specifying the waiting period for a record.
String qrySelect Simple query select statement. Default is “*NONE”.
String qryKeyFlds Simple query search keys statement. Default is “*NONE”.
String qryFileName Simple query file name. Default is “*NAME”.
Boolean isDefaultRFN DatabaseFileBase isDefaultRFN param.
Boolean isKeyed DatabaseFileBase isKeyed param.
Action infSR DatabaseFileBase infSR param.

Properties

Type Name Description
Int32 BlockingFactor Gets or sets the integer that determines if and optionally how many database records will be blocked across the Network for better performance when reading or writing groups of records. Network blocking significantly reduces the network burden of transferring records between server and client machines, and this is demonstrated by the substantial increase of data throughput.
Boolean CheckFormatID Gets or sets the value that specifies if the Format IDs of the file should be checked when the file is opened.
FileAdapter fileAdapter fileAdapter summary.
String FilePath Gets or sets the path to the file in the Database, given as “library/filename”.
String FormatName Gets the name of the record format.
Boolean InhibitWrites Prevents operations to the file from actually updating it, effectively treating the operation as a no-op.
Boolean IsDefaultRFN Gets or sets the value that specifies if the “default” renamed format is going to be used.
Boolean IsFormatID Obsolete. Use CheckFormatID.
Boolean IsKeyed Gets the value that specifies if the file has been opened for “keyed” access.
String LibraryName Gets the library name for an open fileAdapter.
String MemberName Gets or sets the name of the file member.
String QryFileName Gets or sets the string that specifies the name of the query file created for the QrySelect and QryKeyFlds parameters. If *Name is specified, which is the default, the file name given on the DCLDISKFILE command is used.
String QryKeyFlds Gets or sets the string used to specify the name of one or more key fields used to arrange the query records. Each key field is composed of a field name followed by optional attributes that determine the sorting order (ascending descending, or absolute value for numeric fields).
String QrySelect Gets or sets the string specifying the selection expression used to determine which records are to be made available for processing. The select expression syntax is the same as for a Select/Omit expression in Acceler8DB.
List<String> queryKeys Gets or sets the list of keys for building queries.
List<KeyUsages> queryUsages Gets or sets the list of key usages for queries.
Int64 RecCount Gets the current number of records in the file.
Int64 RecNum Gets the current RRN for input operations made to a database file opened with type of access as Input or Update.
Boolean ShareOpenDataPath Gets or sets the value that specifies if the file can be shared with other programs.
String ShareType Gets or sets the string defining how a file will be shared.
Int32 StarFile Integer value of the *FILE constant.
Int32 WaitRec Gets or sets the integer specifying the waiting period for a record.

Methods

Signature Description
chainKey(String, AdgKeyTable, Boolean) Read a record format using a key.
chainKey(String, AdgKeyTable, Boolean, IDS) Read a record format using a key.
chainRRN(String, Int32, Boolean) Read a record format using the relative record number.
chainRRN(String, Int32, Boolean, IDS) Read a record format using the relative record number.
CheckKey(String, AdgKeyTable) Check whether a record exists.
close() Close the database file.
DeleteByKey(String, AdgKeyTable) Delete a record.
deleteByRRN(String, Int32) Delete a record using its relative record number.
DeleteCurrent(String) Delete the current record.
DeleteRange(String, AdgKeyTable, AdgKeyTable, Boolean, Int32) Delete a range of records.
Feod(String) Force end of data on the given record.
GetAlternateKeyTable(String) For multiformat files, get the alternate AdgKeyTable for a given record format.
GetKeyTable(String) For multiformat files, get the AdgKeyTable for a given record format.
open(Database, AccessMode, Boolean, Boolean, ServerCursors) Open the database file.
Open(Database, AccessMode, Boolean, Boolean, ServerCursors) Open the database file.
ReadEqualIncompleteKey(String, AdgKeyTable, String, Boolean, Boolean) Read sequentially a record with an incomplete key buffer.
ReadEqualIncompleteKey(String, AdgKeyTable, String, Boolean, Boolean, IDS) Read sequentially a record with an incomplete key buffer.
ReadEqualKey(String, AdgKeyTable, Boolean, Boolean) Read the adjacent record sequentially, if it has the same key.
ReadEqualKey(String, AdgKeyTable, Boolean, Boolean, IDS) Read the adjacent record sequentially, if it has the same key.
ReadRange(String, AdgKeyTable, AdgKeyTable, Boolean, Boolean, Int32, Boolean) Read a range of records.
ReadSeq(String, Boolean, Boolean) Read the next record sequentially.
ReadSeq(String, Boolean, Boolean, IDS) Read the next record sequentially.
Seek(String, AdgKeyTable, Int32) Seek to a particular record. Position the cursor according to the readMode parameter.
SeekRRN(String, Int32, Int32) Seek to a particular record using its relative record number. Position the cursor according to the readMode parameter.
SetRange(String, AdgKeyTable, AdgKeyTable, Boolean, Boolean, Int32) Seek a range of records.
Unlock() Unlock a record.
update(String, Char[]) Update a record.
update(String, Char[], IDS) Update a record.
Update(String, Indicator[]) Update a record.
Update(String, Indicator[], IDS) Update a record.
updateFlds(String, String[]) Update a record, only those fields listed in fieldNames.
write(String, Char[]) Write a record.
write(String, Char[], IDS) Write a record.
Write(String, Indicator[]) Write a record.
Write(String, Indicator[], IDS) Write a record.

void chainKey(string formatName, AdgKeyTable key, bool noLock)

Read a record format using a key.

void chainKey(string formatName, AdgKeyTable key, bool noLock)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
Boolean noLock True to leave the record unlocked after the operation.

void chainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)

Read a record format using a key.

void chainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
Boolean noLock True to leave the record unlocked after the operation.
IDS intoDS IDS object that receives the data read.

void chainRRN(string formatName, int rrn, bool noLock)

Read a record format using the relative record number.

void chainRRN(string formatName, int rrn, bool noLock)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
Int32 rrn Relative record number of the record to read.
Boolean noLock True to leave the record unlocked after the operation.

void chainRRN(string formatName, int rrn, bool noLock, IDS intoDS)

Read a record format using the relative record number.

void chainRRN(string formatName, int rrn, bool noLock, IDS intoDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
Int32 rrn Relative record number of the record to read.
Boolean noLock True to leave the record unlocked after the operation.
IDS intoDS IDS object that receives the data read.

bool CheckKey(string formatName, AdgKeyTable key)

Check whether a record exists.

bool CheckKey(string formatName, AdgKeyTable key)

Parameters

Type Parameter name Description
String formatName Name of the record format to check.
AdgKeyTable key An AdgKeyTable object containing the key of the record to check.

Returns

Type Description
Boolean True if the record exists.

void close()

Close the database file.

void close()

void DeleteByKey(string formatName, AdgKeyTable key)

Delete a record.

void DeleteByKey(string formatName, AdgKeyTable key)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.

void deleteByRRN(string formatName, int rrn)

Delete a record using its relative record number.

void deleteByRRN(string formatName, int rrn)

Parameters

Type Parameter name Description
String formatName Name of the record format to delete.
Int32 rrn Relative Record Number.

void DeleteCurrent(string formatName)

Delete the current record.

void DeleteCurrent(string formatName)

Parameters

Type Parameter name Description
String formatName Name of the record format to delete.

void DeleteRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool includeFirstKey, int includeLastKey)

Delete a range of records.

void DeleteRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool includeFirstKey, int includeLastKey)

Parameters

Type Parameter name Description
String formatName Name of the record format to delete.
AdgKeyTable firstKey Key of the first record in the range.
AdgKeyTable lastKey Key of the last record in the range.
Boolean includeFirstKey True to include the first record in the delete operation.
Int32 includeLastKey 0 to include, 1 to exclude, 2 to use the same option as the one for the first record.

void Feod(string formatName)

Force end of data on the given record.

void Feod(string formatName)

Parameters

Type Parameter name Description
String formatName Name of the record format.

AdgKeyTable GetAlternateKeyTable(string formatName)

For multiformat files, get the alternate AdgKeyTable for a given record format.

AdgKeyTable GetAlternateKeyTable(string formatName)

Parameters

Type Parameter name Description
String formatName Name of the record format.

Returns

Type Description
AdgKeyTable The alternate AdgKeyTable for the record format.

AdgKeyTable GetKeyTable(string formatName)

For multiformat files, get the AdgKeyTable for a given record format.

AdgKeyTable GetKeyTable(string formatName)

Parameters

Type Parameter name Description
String formatName Name of the record format.

Returns

Type Description
AdgKeyTable The AdgKeyTable for the record format.

void open(Database database, AccessMode accessMode, bool isCacheWrite, bool isCommit, ServerCursors serverCursor)

Open the database file.

void open(Database database, AccessMode accessMode, bool isCacheWrite, bool isCommit, ServerCursors serverCursor)

Parameters

Type Parameter name Description
Database database Database where the file is located.
AccessMode accessMode AccessMode of the file.
Boolean isCacheWrite True to enable cache writes.
Boolean isCommit True to have file operations under commitment control.
ServerCursors serverCursor ServerCursors option value.

void Open(Database database, AccessMode accessMode, bool isCacheWrite, bool isCommit, ServerCursors serverCursor)

Open the database file.

void Open(Database database, AccessMode accessMode, bool isCacheWrite, bool isCommit, ServerCursors serverCursor)

Parameters

Type Parameter name Description
Database database Database where the file is located.
AccessMode accessMode AccessMode of the file.
Boolean isCacheWrite True to enable cache writes.
Boolean isCommit True to have file operations under commitment control.
ServerCursors serverCursor ServerCursors option value.

void ReadEqualIncompleteKey(string formatName, AdgKeyTable key, string incompleteKeyBuffer, bool noLock, bool previous)

Read sequentially a record with an incomplete key buffer.

void ReadEqualIncompleteKey(string formatName, AdgKeyTable key, string incompleteKeyBuffer, bool noLock, bool previous)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
String incompleteKeyBuffer Incomplete key buffer.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.

void ReadEqualIncompleteKey(string formatName, AdgKeyTable key, string incompleteKeyBuffer, bool noLock, bool previous, IDS intoDS)

Read sequentially a record with an incomplete key buffer.

void ReadEqualIncompleteKey(string formatName, AdgKeyTable key, string incompleteKeyBuffer, bool noLock, bool previous, IDS intoDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
String incompleteKeyBuffer Incomplete key buffer.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.
IDS intoDS IDS object that receives the data read.

void ReadEqualKey(string formatName, AdgKeyTable key, bool noLock, bool previous)

Read the adjacent record sequentially, if it has the same key.

void ReadEqualKey(string formatName, AdgKeyTable key, bool noLock, bool previous)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.

void ReadEqualKey(string formatName, AdgKeyTable key, bool noLock, bool previous, IDS intoDS)

Read the adjacent record sequentially, if it has the same key.

void ReadEqualKey(string formatName, AdgKeyTable key, bool noLock, bool previous, IDS intoDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable key An AdgKeyTable object containing the key of the record to read.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.
IDS intoDS IDS object that receives the data read.

void ReadRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool startAt, bool includeFirstKey, int includeLastKey, bool noLock)

Read a range of records.

void ReadRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool startAt, bool includeFirstKey, int includeLastKey, bool noLock)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
AdgKeyTable firstKey Key of the first record in the range.
AdgKeyTable lastKey Key of the last record in the range.
Boolean startAt True to use RangeMode.Last.
Boolean includeFirstKey True to include the first record in the delete operation.
Int32 includeLastKey 0 to include, 1 to exclude, 2 to use the same option as the one for the first record.
Boolean noLock True to leave the record unlocked after the operation.

void ReadSeq(string formatName, bool noLock, bool previous)

Read the next record sequentially.

void ReadSeq(string formatName, bool noLock, bool previous)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.

void ReadSeq(string formatName, bool noLock, bool previous, IDS intoDS)

Read the next record sequentially.

void ReadSeq(string formatName, bool noLock, bool previous, IDS intoDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to read.
Boolean noLock True to leave the record unlocked after the operation.
Boolean previous True to read the previous record. False to read the next.
IDS intoDS IDS object that receives the data read.

void Seek(string formatName, AdgKeyTable key, int readMode)

Seek to a particular record. Position the cursor according to the readMode parameter.

void Seek(string formatName, AdgKeyTable key, int readMode)

Parameters

Type Parameter name Description
String formatName Name of the record format.
AdgKeyTable key An AdgKeyTable object containing the key of the record to seek.
Int32 readMode The SeekMode integer value indicating where the cursor will be in relation to the record.

void SeekRRN(string formatName, int rrn, int readMode)

Seek to a particular record using its relative record number. Position the cursor according to the readMode parameter.

void SeekRRN(string formatName, int rrn, int readMode)

Parameters

Type Parameter name Description
String formatName Name of the record format.
Int32 rrn Relative record number of the record to seek.
Int32 readMode The SeekMode integer value indicating where the cursor will be in relation to the record.

void SetRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool startAt, bool includeFirstKey, int includeLastKey)

Seek a range of records.

void SetRange(string formatName, AdgKeyTable firstKey, AdgKeyTable lastKey, bool startAt, bool includeFirstKey, int includeLastKey)

Parameters

Type Parameter name Description
String formatName Name of the record format.
AdgKeyTable firstKey Key of the first record in the range.
AdgKeyTable lastKey Key of the last record in the range.
Boolean startAt True to use RangeMode.Last.
Boolean includeFirstKey True to include the first record in the delete operation.
Int32 includeLastKey 0 to include, 1 to exclude, 2 to use the same option as the one for the first record.

void Unlock()

Unlock a record.

void Unlock()

void update(string formatName, Char[] optionIndicators)

Update a record.

void update(string formatName, Char[] optionIndicators)

Parameters

Type Parameter name Description
String formatName Name of the record format to update.
Char[] optionIndicators Indicator array to use in the update operation.

void update(string formatName, Char[] optionIndicators, IDS fromDS)

Update a record.

void update(string formatName, Char[] optionIndicators, IDS fromDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to update.
Char[] optionIndicators Indicator array to use in the update operation.
IDS fromDS IDS object where the data comes from.

void Update(string formatName, Indicator[] optionIndicators)

Update a record.

void Update(string formatName, Indicator[] optionIndicators)

Parameters

Type Parameter name Description
String formatName Name of the record format to update.
Indicator[] optionIndicators Indicator array to use in the update operation.

void Update(string formatName, Indicator[] optionIndicators, IDS fromDS)

Update a record.

void Update(string formatName, Indicator[] optionIndicators, IDS fromDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to update.
Indicator[] optionIndicators Indicator array to use in the update operation.
IDS fromDS IDS object where the data comes from.

void updateFlds(string formatName, String[] fieldNames)

Update a record, only those fields listed in fieldNames.

void updateFlds(string formatName, String[] fieldNames)

Parameters

Type Parameter name Description
String formatName Name of the record format to update.
String[] fieldNames Array of field names to update.

void write(string formatName, Char[] optionIndicators)

Write a record.

void write(string formatName, Char[] optionIndicators)

Parameters

Type Parameter name Description
String formatName Name of the record format to write.
Char[] optionIndicators Indicator array to use in the write operation.

void write(string formatName, Char[] optionIndicators, IDS fromDS)

Write a record.

void write(string formatName, Char[] optionIndicators, IDS fromDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to write.
Char[] optionIndicators Indicator array to use in the write operation.
IDS fromDS IDS object where the data comes from.

void Write(string formatName, Indicator[] optionIndicators)

Write a record.

void Write(string formatName, Indicator[] optionIndicators)

Parameters

Type Parameter name Description
String formatName Name of the record format to write.
Indicator[] optionIndicators Indicator array to use in the write operation.

void Write(string formatName, Indicator[] optionIndicators, IDS fromDS)

Write a record.

void Write(string formatName, Indicator[] optionIndicators, IDS fromDS)

Parameters

Type Parameter name Description
String formatName Name of the record format to write.
Indicator[] optionIndicators Indicator array to use in the write operation.
IDS fromDS IDS object where the data comes from.