@IsDB2 (Formula Language)
Given a server and filename or server and replica ID, indicates if the specified database is backed by DB2® or not.
Syntax
@IsDB2(server : file)
@IsDB2(server ; replicaID)
Parameters
server
Text. The name of the server. Use an empty string ("") to indicate the local computer.
file
Text. The path and file name of the database. Specify the database path and file name using the appropriate format for the operating system.
replicaID
Text. The replica ID of the database.
Return value
flag
Boolean
- 1 (True) indicates that the specified database is backed by DB2®
- 0 (False) indicates that the specified database is not backed by DB2®
This function will return an error via @Error if:
- The server cannot be reached
- The database specified in file or replicaID cannot be found
Examples
- This formula returns 0 (False), since the local names.nsf database
is not in DB2®:
@IsDB2("":"names.nsf")
- These formulas both return DB2® information
about the current database:
@IsDB2(@DbName) @IsDB2("":"")
- This formula returns 1 if FRITES.NSF in the MAIL directory on
the server Belgium is DB2® backed.
Otherwise it returns 0.
@IsDB2( "Belgium" : "mail\\frites.nsf" )
- This formula returns DB2® information
about a database using its replica ID instead of its file name:
@IsDB2("Cheshire";"852556DO:00576146")
- This example of a column formula first uses @IsDB2 to find out
if the local database referenced in the dbname field of the document
is a DB2® database, so that a
more meaningful error message may be displayed from @DB2Schema:
result1 := @IsDB2("":dbname); result2 := @DB2Schema("":dbname) @If(@IsError(result1);"Unable to find database or lost server connection"; result1;@If(@IsError(result2); "Unable to find database or lost server connection";result2); "Not a DB2 database");
Usage
This function works in all contexts where @function use is supported, including view selection formulas, column formulas, and from the Web.
If the database has been replicated to a local replica, and an empty string is specified for the server parameter, @IsDB2 will produce an error on the replica. For this reason, it is extremely important to use @Error processing with @IsDB2 when using relative paths.