User Guide > User Guide > A. Command Reference > Where to Issue Commands
Was this helpful?
Where to Issue Commands
Vector commands are issued at the command line.
General Command Syntax
A command consists of one or more required command words, usually followed by one or more flags or parameters:
command [flags] [parameters]
A flag is a command option that consists of a letter preceded by a hyphen (-). A flag may stand alone (-f), or be followed by a parameter (-fparameter). Generally, there is no space between a flag and parameter.
Flags are shown in lowercase unless they are required to be uppercase. Uppercase flags may need special input syntax if the host operating system is case-insensitive.
A parameter is a command line option that is not a flag. A parameter can be the name of a database, a table or other object, or a value that specifies a particular use for a command.
In general, you can enter command options in any order. A few commands, however, require options in a specific order.
Dynamic Vnode Specification--Connect to Remote Node
When connecting to a remote node (using the vnode::dbname syntax), you can specify a dynamic vnode instead of a vnode name. The dynamic vnode specification includes the connection data, user authorization, and attributes that are associated with a remote node.
Note:  A dynamic vnode can be used wherever a vnode is allowed, unless otherwise stated.
A dynamic vnode specification has the following format:
@host,protocol,port[;attribute=value{;attribute=value}][[user,password]]
@host
Identifies the network name or address of the node on which the remote database is located. The @ character is required because it identifies this specification as a dynamic vnode rather than a vnode name.
protocol
Identifies the network protocol to be used by the local node to connect to the remote node. For a list of protocols and their associated keywords, see the Connectivity Guide.
port
Identifies the listen address of the Vector instance on the remote node.
attribute=value
(Optional) Is one or more additional connection, encryption, and authentication attributes for the connection. For a description of each attribute and its possible values, see the Connectivity Guide.
[user,password]
Identifies the user name and password for the user on the remote system.
Note:  If used, the user and password must be enclosed in brackets. For example: [Johnny, secretpwd]. They are required if you want to authenticate using the default Ingres security mechanism.
Rather than specifying [user,password] in the dynamic vnode syntax, you can use the +user=authuser syntax before the dynamic vnode specification. The +user flag causes a prompt for the password, which protects the password from exposure. For example:
sql +user=johnny @machine01,tcp_ip,II::inventory
If the +user flag is used, you cannot also specify the [user,password] option as part of the dynamic vnode.
Examples of dynamic vnode specification:
This command runs the terminal monitor (sql) and connects to node hosta using protocol tcp_ip to remote Vector symbolic port VW. The login and password are Johnny and secretpwd. The remote database name is sales_fact:
sql @hosta,tcp_ip,VW;[Johnny,secretpwd]::sales_fact
This command establishes a direct connection by using the connection_type attribute:
sql @hosta,tcp_ip,VW;connection_type=direct[Johnny,secretpwd]::sales_fact
This command will prompt for the DBMS password (the server must be configured with dbms_authentication=on). Because the +user flag is used, the [username, password] syntax cannot be specified on the dynamic vnode.
sql +user=Johnny @hosta,tcp_ip,VW::sales_fact
Standard Flags and Parameters
The following parameters and flags are common to many commands. Each command description in this guide indicates whether these parameters or flags are valid for that command.
The following syntax is typical for many commands:
command dbname|vnode::dbname [-fproduct] [+user[=authuser]]
[-uusername] [-Ggroupid] [-Rroleid] [other flags] [other parameters]
dbname
Identifies the name of a database. This parameter must precede all other non-flag parameters (with the exception of vnode::dbname).
vnode::
Identifies the remote node on which the database is located. It must be followed by two colons (::) and the dbname parameter, with no intervening space.
The remote node can be specified as either of the following:
vnode_name
Is the virtual node name (as defined to Ingres Net) that points to the connection data and authorization data necessary to access a particular remote instance.
@host+
Is a “dynamic vnode” connection string that includes the connection data, user authorization, and attributes that are associated with a remote node. The format of @host+ is described in Dynamic Vnode Specification--Connect to Remote Node.
-fproduct
Specifies the name of a product parameter. In selected commands, the catalog modules for one or more products can be specified. The user interface catalogs are grouped into modules. Each tool requires a set of modules to operate. If you omit the product, the command reads the installation’s authorization string and specifies all products that the authorization string permits.
The product parameter must be one of the following:
ingres
Processes catalogs for the Ingres tools (Applications-By-Forms, Query-By-Forms, Report-By-Forms, and Visual Forms Editor).
ingres/dbd
Processes catalogs for DBD.
vision
Processes catalogs for Vision.
windows_4gl
Processes catalogs for OpenROAD.
nofeclients
Directs the command not to process catalogs for any user interface products. You cannot use the nofeclients name with the name of any valid user interface product; nofeclients is valid only in specified commands.
+user[=authuser]
Specifies the user name (authuser) and password used for connecting to a remote database, whether through OS authentication, DBMS authentication, or another mechanism. This syntax is useful when using DBMS authentication because it allows password entry or prompting with simplified syntax.
One of the following can be used:
+user
Prompts for the password of the user.
+user=username
Connects as the specified user name and prompts for password.
@[username, password]
Connects as the specified user name and password. Password is exposed on the command line.
-uusername
Specifies the effective user name for the session. Valid only for a privileged user, DBA, or sessions that have the db_admin database privilege. (Some commands, including ckpdb, rollforwarddb, verifydb, createdb, and destroydb, restrict the use of the -u flag to privileged users.)
Note:  The -u flag does not assume the group of the effective user. Use the -G flag to distinguish between the real and effective user.
-Ggroupid
Specifies the group identifier for the session. After the system administrator defines a group identifier, a DBA can grant database permissions to the group. When you issue a command, specifying group ID (using the -G flag), the group’s permissions are applied to the session.
To specify a group, you must be a member of the specified group identifier’s user list, a system administrator, the DBA of the specified database, or a user that has the db_admin privilege.
If you omit this flag and there is a default group identifier specified for you, the default group identifier is assigned to the session. (Default group identifiers are assigned using accessdb.)
-Rroleid
Specifies the role identifier for an application image. After the system administrator defines a role identifier, a DBA can grant database permissions to the role ID. When you invoke an application and specify role ID (using the -R flag), the role permissions are applied to your session.
The roleid must be an existing role identifier. If the role identifier requires a password, you are prompted for the password. If you specify the -R flag, but omit both the role identifier and password, you are prompted for both. If no password is defined for the specified roleid, press the Enter key when prompted for the password.
Neither roleid nor password is validated if you are a system administrator, DBA for the specified database, or a user that has the db_admin privilege.
Schema Qualifier--Specify Ownership
A schema is a collection of database objects, such as tables. Each table, view, and synonym belongs to a schema that is determined when the object is created. The schema name corresponds to the user who owns the object. The schema name allows you to distinguish between objects with identical names but different owners.
You can specify a schema name for a table, view, or synonym on the command line to specify ownership. You use the following syntax:
schema.objectname
The period (.) must immediately follow the schema name and precede the object name, with no intervening spaces. Both the schema name and the object name can be delimited identifiers.
For example, to specify the table named “empinfo” having a schema name of dave, you would specify the table name as:
dave.empinfo
You do not use a schema name when referencing a table, view, or synonym; for example, you specify the table name as:
empinfo
The search looks first for an object with a schema corresponding to the current user; then it looks for an object owned by the DBA to which you have access. Lastly, if the object name begins with ii, the search looks for a system catalog with that name.
Delimited Identifiers on the Command Line
Delimited identifiers are database object names that are identical to reserved words, words that contain spaces, and non-alphanumeric characters that are disallowed in a regular identifier. If the installation allows mixed case names, you can also use delimited identifiers to distinguish among identical names with different case (for example, SALES and Sales).
On the command line, you use delimited identifiers if needed for names of tables, views, synonyms, schema, and authorization names (users, groups, and roles).
To create a delimited identifier, you must enclose the name in double quotation marks ("), dereference any embedded quotes, and use the appropriate number and type of delimiting quotes to pass it through your operating system. Use delimited identifiers on the operating system command line to specify database object names:
report my_database "Jane's table"
You must observe any operating system requirements for specifying quoted parameters, parameters containing embedded quotes, and parameters containing other characters that could be interpreted differently by the operating system. Depending on your operating system, you add delimiting and dereferencing quotes to a delimited identifier on the command line in order to pass it through the operating system with its own delimiting and embedded quotes (if any).
Delimited Identifiers Used on Authorization Parameters
You can use delimited identifiers to specify a username for the ‑u flag, a groupid parameter for the ‑G flag, or a roleid for the ‑R flag on the command line. A general example is:
sreport my_database myfile -u”user 5” -G”group 2”
Here are examples:
Windows:
sreport my_database myfile -u'”user 5”' -G'”group 2”'
Linux:
sreport my_database myfile -u'”user 5”' -G'”group 2”'
Delimited Identifiers and Case Sensitivity
Case sensitivity for regular and delimited identifiers is defined by configuration parameters. At the time a database is created, the current settings of those parameters are stored with the database.
By default, delimited identifiers are stored in mixed case.
To determine the settings for the database to which a session is connected
Use the DBMSINFO function, as follows:
SELECT DBMSINFO('DB_NAME_CASE')
and
SELECT DBMSINFO('DB_DELIMITED_CASE')
Last modified date: 01/26/2023