Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


MIMLOAD - Data Load and Unload


MIMLOAD enable you to use the LOAD and UNLOAD commands at your operating system's command prompt.

Syntax

You control MIMLOAD using flagged information specified on the command-line.

The overall syntax for MIMLOAD (expressed in short form UNIX-style) is:

 mimload [-u user] [-p password] [-e program -i password] "statement" [database]
 
Note: If you are using double quotes in the LOAD/UNLOAD statement, they must be escaped using the back-slash character \ when UNIX-style switches are used. For VMS-style switches, a double quote " is used as escape character.

Command-line Arguments

You can use the following arguments with MIMLOAD.

UNIX/Windows-style
VMS-style
Function
 -u user
 --username=username
 /USERNAME=username

Specifies the username used when connecting to Mimer.

If not specified, OS_USER is assumed.
 -p password
 --password=password
 /PASSWORD=password
Specifies the password for the user.
When connecting an OS_USER, no password is needed.
VMS: Note that in a Open VMS environment it might be necessary to enclose the password in quotation marks as the value otherwise is translated to upper case.
 -e program
 --program=program
 /PROGRAM=program
Specifies an optional program ident, to be entered in the connection phase.
This can be specified more than once and thus allows entering deeper entry levels.
 -i password
 --using=password
 /USING=password
Password for the program ident specified by the preceding --program switch.
 "statement"
 "statement"
Specifies the LOAD/UNLOAD statement. Enclose in double quotes.
 database
 database
Specifies the name of the database to access. If specified, it must be the last argument.
If you do not specify a database name, the default database will be used.
 -?
 --help
 /HELP
Show help text.

Exit Codes

The following error codes are used:

UNIX/Windows
OpenVMS
Usage
 0 (success)
1 (success)
This code is used when MIMLOAD has executed successfully.
 > 1 (error)
2 (error)
This error code is used when MIMLOAD failed to execute successfully.

Examples

Loading Data

The following example loads the file store.sql into the default database.

UNIX/Windows-style
 mimload --username=user1 --password=UsrPwd "load from 'store.sql' log stderr"
VMS-style
 MIMLOAD /USERNAME=USER1 /PASSWORD="UsrPwd" "LOAD FROM 'STORE.SQL' LOG STDERR"

Unloading Data

'The following example unloads all the definitions and data owned by the user store_adm from the database store to the file store.sql.

UNIX/Windows-style
 mimload -u store_adm -p StrPwd "unload to 'store.sql' from current user" store
VMS-style
 MIMLOAD /USERNAME=STORE_ADM /PASSWORD="StrPwd" "UNLOAD TO 'STORE.SQL' FROM 
CURRENT USER" STORE

Using STDIN/STDOUT/STDERR

STDIN, STDOUT and STDERR are short names for the standard input, standard output and standard error streams, respectively.

Windows/UNIX-style Examples

In the commands below, STDIN is denoted by '<' (this is short for '0<', equal to reading from file descriptor number 0 which is the standard input). STOUT is denoted by '>' (this is short for '1>', equal to writing to file descriptor number 1 which is the standard output) and STDERR is denoted by '2>' (equal to writing to file descriptor number 2 which is the standard error).

In the following example, the generated output from UNLOAD is written to standard output, which in this case is redirected to the file store_db.unl. The log information is written to standard error, which is redirected to the file store_db.log.

 mimload -u store_adm -p StrPwd "unload to stdout log stderr from databank 
store_db" store > store_db.unl 2> store_db.log
 

In the following example, input to LOAD is taken from standard input, i.e. from the file store_db.unl, and log information is written to standard error, in this case to the file store_db_load.log.

 mimload -u store_adm -p StrPwd "load from stdin log stderr" store < 
store_db.unl 2> store_db_load.log

VMS-style Examples

In the OpenVMS environment, you can use STDIN, STDOUT and STDERR in two ways, either by defining SYS$INPUT, SYS$OUTPUT and SYS$ERROR or by using pipe mode which gives the UNIX behavior for use of file redirection. Both methods are shown below.

In the following example, the generated output from UNLOAD is written to standard output, which in this case is redirected to the file D1:<DATA>STORE_DB.UNL. The log information is written to standard error, which is redirected to the file D1:<LOG>STORE_DB.LOG.

Example using SYS$OUTPUT and SYS$ERROR:

 DEFINE/USER SYS$ERROR D1:<LOG>STORE_DB.LOG
 DEFINE/USER SYS$OUTPUT D1:<DATA>STORE_DB.UNL
 MIMLOAD /USERNAME=STORE_ADM /PASSWORD="StrPwd" "UNLOAD TO STDOUT LOG STDERR 
FROM DATABANK STORE_DB" STORE

Example using pipe mode:

 PIPE MIMLOAD /USERNAME=STORE_ADM /PASSWORD="StrPwd" "UNLOAD TO STDOUT LOG 
STDERR FROM DATABANK STORE_DB" STORE > D1:<DATA>STORE_DB.UNL 2> 
D1:<LOG>STORE_DB.LOG
 

In the following example, input to LOAD is taken from standard input, i.e. from the file D1:<DATA>STORE_DB.UNL, and log information is written to standard error, in this case to the file D1:<LOG>STORE_DB_LOAD.LOG.

Example using SYS$OUTPUT and SYS$ERROR:

 DEFINE/USER SYS$ERROR D1:<LOG>STORE_DB_LOAD.LOG
 DEFINE/USER SYS$INPUT D1:<DATA>STORE_DB.UNL
 MIMLOAD /USERNAME=STORE_ADM /PASSWORD="StrPwd" "LOAD FROM STDIN LOG STDERR" 
STORE
 

Example using pipe mode:

 PIPE MIMLOAD /USERNAME=STORE_ADM /PASSWORD="StrPwd" "LOAD FROM STDIN LOG 
STDERR" STORE < D1:<DATA>STORE_DB.UNL 2> D1:<LOG>STORE_DB_LOAD.LOG

Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX