READ_ONLY configuration variable

This variable establishes the default read/write permission for all the files belonging to the associated DSN. By default, this variable is set to 0 (off, false, no), indicating that users can write to the files. Specify 1 (on, true, yes) if you want to make the files read-only.

What you indicate for read/write permission here applies to all files in the data source. If you want to assign different permissions to any individual files, you can do so using file aliases. For more information on file aliases, see the section Setting Up File Aliases.

File (table) level read/write protection can also be defined by granting object privileges to specific users or to the PUBLIC user. You do this with the SQL GRANT (Object Properties) statement. For example, to make a table read-only to all users, you could issue the following command using xdbcquery (for information about this tool, see Using the Command-line Query Tool):

GRANT SELECT ON TABLE1 TO PUBLIC

Field (column) level read/write protection can be further defined using the READ-ONLY directive.

Note: When executing a SELECT statement, Micro Focus XDBC opens indexed files as INPUT regardless of how this variable is set. When the user attempts to update a row (from Microsoft Access, for example), if the READ_ONLY configuration variable is off, Micro Focus XDBC attempts to open the indexed file for update. If the COBOL program has the record locked during a Micro Focus XDBC SELECT, and that record has met the SELECT conditions, a locked record condition occurs. When the COBOL program updates a record previously retrieved during a Micro Focus XDBC, the update takes effect. When Micro Focus XDBC attempts to update the record, an error occurs indicating that the record has been changed by another process after the original Micro Focus XDBC SELECT.