Returns a character string that describes features
that are not supported for this database. You can use this function
with OpenEdge DataServers.
Syntax
DBRESTRICTIONS
( {integer-expression|logical-name|alias}
[ , table-name]
)
|
-
integer-expression
- The sequence number of a database the ABL session is connected to. For example,
DBRESTRICTIONS(1) returns information on the first database the ABL session is connected
to, DBRESTRICTIONS(2) returns information on the second database the ABL session is
connected to, and so on. If you specify a sequence number that does not correspond to a
database the ABL session is connected to, the DBRESTRICTIONS function returns the
Unknown value (?).
-
logical-name or alias
- These forms of the DBRESTRICTIONS function require a character expression as a
parameter. An unquoted character string is not permitted. If the parameter is an alias
or the logical name of a connected database, then the AVM returns the database
restrictions string. Otherwise, it returns the Unknown value (?).
-
table-name
- A character expression equal to the name of a table in the specified database. An
unquoted character string is not permitted. If the table name is valid, DBRESTRICTIONS
returns the list of unsupported features for the specified table. Otherwise, it returns
the Unknown value (?).
Example
This
procedure displays the logical name and database restrictions of
all connected databases:
r-dbrest.p
DEFINE VARIABLE ix AS INTEGER NO-UNDO.
REPEAT ix = 1 to NUM-DBS:
DISPLAY LDBNAME(ix) LABEL "Database"
DBRESTRICTIONS(ix) FORMAT "x(40)" LABEL "Restrictions".
END.
|
Notes
- If
you want to use the DBRESTRICTIONS function for a database, you
must be connected to the database in the current ABL session.
-
DBRESTRICTIONS returns a string. This string is a comma-separated list of keywords that
represent features not supported by the specified database. The following table shows
the possible keywords and their descriptions.
DBRESTRICTIONS keyword values
Keyword |
Description |
COUNT-OF |
Cannot use the COUNT-OF function. |
LAST |
Cannot invoke the FIND LAST statement. |
PREV |
Cannot invoke the FIND PREV statement. |
READ-ONLY |
The database or table is available for read only. |
RECID |
Cannot use the RECID function. |
SET-CURRENT-VALUE |
Cannot set the current value of sequence generators. |
SETUSERID |
Cannot use the SETUSERID function. |
For example, if the database is accessed through a manager that does not support FIND
LAST and FIND PREV, then the DBRESTRICTIONS function returns the string LAST, PREV.
-
The possible keyword values returned by DBRESTRICTIONS depends on the DataServer type.
The following table shows the possible values returned for each DataServer.
DBRESTRICTIONS return values by DataServer
DataServer |
Possible return values |
ORACLE |
"LAST,PREV,READ-ONLY,RECID,SETUSERID,
SET-CURRENT-VALUE" |
OpenEdge |
"READ-ONLY" |
Note: The available DataServers depend on your version of OpenEdge. For more
information, see your OpenEdge DataServer documentation.
- The form of the returned string makes it easy to use with the ENTRY and LOOKUP function.
- If you connect to a database with the Read Only (-RO) parameter, the AVM lists the
character string READ-ONLY in the restrictions list for that database.
See also
ALIAS function, CONNECT statement, CONNECTED function, CREATE ALIAS statement, CREATE CALL statement, DATASERVERS function, DBCODEPAGE function, DBCOLLATION function, DBTYPE function, DBVERSION function, DELETE ALIAS statement, DISCONNECT statement, FRAME-DB function, LDBNAME function, NUM-DBS function, PDBNAME function, SDBNAME function