Prev | SQL Engine Reference | Next |
SET OWNER
The SET OWNER statement allows you to specify one or more Btrieve owner names for use during the current database connection.
Syntax
SET OWNER = [']ownername['] [,[']ownername[']] ...Remarks
The SET OWNER statement allows you to specify a list of owner names for data files that have owner names assigned through the MicroKernel. The SRDE passes the owner names to the MicroKernel, enabling it to open the data files.
You can specify any number of owner names with a SET OWNER statement. If an owner name begins with a non-alphabetic character, you must enclose the name in single quotes (' ').
The statement is effective for the current connection only. If the current user logs out after issuing a SET OWNER command, the user must re-issue the command the next time the user logs in.
Each SET OWNER statement issued during the same connection re-sets the owner list; that is, only the owner names specified in the most recent SET OWNER statement are passed to the MicroKernel. You cannot "add" owner names to the owner list with subsequent statements.
In a database with security turned Off, this command has the effect of allowing full access to any data file (table) that has a Btrieve owner name the same as any name supplied in the SET OWNER list.
In a database with security turned On, this command has no effect for most users. It only has an effect when it is issued by the Master user. If the Master user has not granted himself permissions yet, issuing this command gives the master user full access to any data file with one of the specified Btrieve owner names. Also, if the Master user chooses to give himself permissions, he does not need to use the owner-name in the GRANT statement, if he has already performed the SET OWNER with the correct owner name for the table he is granting permissions on.
Examples
The following example specifies one owner name.
SET OWNER = '12jerry'The following example specifies several owner names.
SET OWNER = jimbo, terry, maximusThe following example shows the effects of multiple SET OWNER statements within the same connection.
SET OWNER = jimbo, terry, maximus --owner list contains: jimbo,terry,maximus. SET OWNER = fred, jennie, lucinda --owner list now contains: fred,jennie,lucinda. Previous contents are discarded.The following example demonstrates the usage of SET OWNER for the Master user in a secure database. Assume that security has just been turned on, and no permissions have been granted in the database. The "inventory" data file has the owner name "admin".
To grant himself permissions, the Master user has two options. The Master user can issue a SET OWNER followed by a GRANT without an owner name, or the Master user can issue a GRANT that specifies the owner name. Both methods achieve the same result:
SET OWNER = admin GRANT ALL ON inventory TO MASTERGRANT ALL ON inventory admin TO MASTERSee Also
Prev SET DECIMALSEPARATORCOMMA |
Contents Up Check for Revisions | Next SET PASSWORD |