IDAX.EXPORT_MODEL - Export model

Use this stored procedure to export models so that they can be imported to another database.

Authorization

The privileges held by the authorization ID of the statement must include at least one of the following authorities:

  • DATAACCESS authority
  • SELECT privilege on all tables within all exported models.
    Note: To use the acl parameter, the authorization ID of the statement must also have one of the following authorities:
    • SECADM
    • DBADM
    • SQLADM
    • ACCESSCTRL
    • DATAACCESS

Syntax

IDAX.EXPORT_MODEL(in parameter_string varchar(32672))

Parameter descriptions

parameter_string
Mandatory one-string parameter that contains pairs of <parameter>=<value> entries that are separated by a comma.
Data type: VARCHAR(32672)
The following list shows the parameter values:
directory
Mandatory.
The absolute path of the target directory for the exported file.
The directory must already exist.
Consider using a dedicated directory, or even a temporary directory, for exported models. Using this directory makes it easier to clean up any intermediate files that are left behind in the event of a failed database process.
name
Mandatory.
The file name for the exported file.
acl
Optional.
Specifies whether model privileges (the access control list) are to be included in the exported file.
Default: false
all
Optional.
Specifies whether models from all schemas are to be exported. By default, only models from the current schema are exported.
Note: If you set the all parameter to true, you cannot use the schema parameter.
Default: false
log
Optional.
Specifies whether a log file (with the .elog extension) is to be written. The log file contains a list of successful exported models and error messages for any models that were skipped by the export operation.
Default: false
model
Optional.
The name of the models to be exported.
Separate multiple model names by using a semicolon. If any of the model names use mixed case, you must enclose them by double quotation marks.
You can qualify a model name with a schema name as follows: <schema>.<model>. If you do not include a schema name, the procedure exports the models that are located in the current schema.
overwrite
Optional.
The action that is to be taken in case of a naming conflict.
If the name of a file within the target directory is identical to the name is specified by the name parameter, the export operation fails by default. If you specify overwrite=true, the existing file is deleted before the exported file is written to the target directory.
Default: false
resume
Optional.
Specifies whether the EXPORT_MODEL procedure is to stop when it cannot export a model. By default, any models that cannot be exported are skipped, and the export operation continues.
Default: true
schema
Optional.
Specifies the schema from which the models are to be exported.
Note: You cannot specify the schema parameter if the all parameter is set to true.
Default: current schema
where
Optional.
A clause that filters the models that are to be exported. Any model that is displayed by the LIST_MODELS procedure can be filtered by the WHERE clause.

Returned information

The EXPORT_MODEL procedure returns a result set with the names of all successfully exported models. If the resume parameter is set to true, the result set also includes the name and accompanying error message for all skipped models, except for any models for which the user does not have export privilege.

Examples

  • The following example exports all models from the current schema into /tmp/foo.mdl:
    call idax.export_model('directory=/tmp, name=foo')
  • The following example exports all models from the schema SAMPLE into /tmp/foo.mdl:
    
    call idax.export_model('schema=sample, directory=/tmp, name=foo')
  • The following example exports all models from all schemas into /tmp/foo.mdl:
    call idax.export_model('all=true, directory=/tmp, name=foo')
  • The following example exports models M1 and M2 from the current schema into /tmp/foo.mdl:
    call idax.export_model('model=sample.m1;test.m2, directory=/tmp, name=foo')
  • The following example exports models M1 and M2 from the current schema into /tmp/foo.mdl:
    call idax.export_model('model=m1;m2, directory=/tmp, name=foo')
  • The following example exports the models SAMPLE.M1 and TEST.M2 into /tmp/foo.mdl:
    call idax.export_model('model=sample.m1;test.m2, directory=/tmp, name=foo')
  • The following example exports model M1 from the current schema and all models from the current schema where the model name starts with T into /tmp/foo.mdl:
    call idax.export_model('model=m1, where=modelname like ''T%'', di-rectory=/tmp, name=foo')
  • The following example exports models from schema SAMPLE where the model name starts with T into /tmp/foo.mdl:
    call idax.export_model('schema=sample, where=modelname like ''T%'', directory=/tmp, name=foo')