The new
subcommand is used to create records of the specified type within the database identified by the database command. If no record type is specified, the new
command creates a new database. Each database, including the master database, can be used to create new, empty databases.
% dbcmd new ?recordType? ?option value ...?
dbcmd
recordType
option
value
set
command for the specified record type, which may be present to configure the record at creation time.-name name
-name
property, which is allowed for all record types except files and databases themselves, is used to specify the name of the new record. If no name is specified, the SDK will automatically assign a name that is guaranteed to be unique within the database.-in record
-in
property is used to specify the parent/container record where appropriate. If the -in
property is not specified, the location of the created record may be indeterminate, but is usually in the last appropriate container that was created, if any. (For example, creating a module record without specifying the file to create it in results in the module being placed within the last created file.) An error will result if no appropriate container exists (for example, attempting to create a conformance module if there are no conformance records).The values accepted for the recordType
property are:
-capability
-cgroup
-cmodule
-compliance
-file
-module
-moduleid
-node
-typedef
-ngroup
-notification
-object
-ogroup
-variation
% set db [smilib new] smilib1
% set file [$db new -file] @File1
% set module [$db new -module -name EXAMPLE-MIB -in $file] @File1!EXAMPLE-MIB