Please enable JavaScript to view this site.

R:BASE 11 Help

Syntax: SET STATICDB ON/OFF

 

Default: OFF

 

SET STATICDB activates a read-only schema mode. A user who first connects to a database with STATICDB set to on engages that database to operate in a read-only schema mode whereby any user must have their STATICDB setting on in order to connect to that database.

 

The effect of having STATICDB set on is that no schema changes can occur during that connection session.

 

Schema Reading Mode with SET STATICDB

In a multi-user environment, R:BASE must be aware of any schema modifications made by a user. Being aware of schema modifications, which is necessary for database integrity, entails constantly re-reading schema information.

 

Because many data-processing operations do not make frequent schema changes to the database, such a re-reading unnecessarily slows down processing.

 

The command SET STATICDB ON instructs R:BASE to prevent any schema modifications, therefore, R:BASE does not read schema information. By default, STATICDB is set off. SET STATICDB OFF forces a re-read of schema information before running any command.

 

When connecting to a database with STATICDB set on, R:BASE displays the "Database Schema is Read-Only." message. When STATICDB is set on, any changes made to add new tables or views results in a temporary table/view. The table/view will be dropped when disconnecting from the database. The LIST TABLE command will display the temporary table and view names with a "(T)" next to the name.

 

Also, the following R:BASE commands are not allowed when STATICDB is set on.

 

 

* Access is not allowed to tables created prior to database connection.

 

No ALTER, DROP, CREATE, SCONNECT, SATTACH, SDETACH, ATTACH, and DETACH commands will have any effect. You can issue CREATE, ATTACH, and SATTACH commands but they will only create temporary tables or views. Similarly, PROJECT will create temporary tables with or without the TEMP keyword. Because the database schema is protected from changes, R:BASE doesn't need to worry that a user will change the schema in the middle of a series of commands.

 

The UNLOAD ALL command does not act upon temporary tables. You can, however, unload individual temporary tables with the UNLOAD command.

 

If a user has STATICDB set off, that user cannot connect to a database being used by a user who has STATICDB set on. All users accessing the same database must have matching STATICDB setting.

 

You can find out what the current STATICDB setting is with the SHOW STATICDB command. You can also capture the current STATICDB setting as a value with the CVAL function:

 

SET VAR vcval = (CVAL('STATICDB'))