IMPORT command

The IMPORT command imports objects that are stored in a file and opens them in an available window (temporary storage) or saves them in the current database.

Syntax

To import an object from a file, open it in an available window and save it in the current database:

>>-- IMPORT --- QUERY --- ObjectName FROM FileName -----------------------------<<
             +- PROC -+                            ( +- CONFIRM = YES/NO --------+
                                                     +- COMMENT = Text ----------+
                                                     +- SHARE = YES/NO ----------+
>>-- IMPORT FORM ObjectName FROM FileName --------------------------------------<<
                                          ( +- CONFIRM = YES/NO -----------------+
                                            +- COMMENT = text -------------------+
                                            +- LANGUAGE = ENGLISH/SESSION -------+
                                            +- SHARE = YES/NO -------------------+
>>-- IMPORT TABLE ObjectName FROM FileName --------------------------------------<<
                                       ( +- CONFIRM = YES/NO ---------------------+
                                         +- COMMENT = Text -----------------------+
                                         +- ACTION = REPLACE/APPEND --------------+
                                         +- ACCELERATOR = acceleratorname --------+
                                         +- ACCELERATORDATABASE = databasename ---+
                                         +- SPACE = tablespace/database.tablespace+
                                         +- SPACE DATABASE = database-------------+ 

To import an object, query result data or LOB data from a file to an open window (temporary storage):

>>-- IMPORT --- QUERY --- FROM FileName -----------------------<<
             +- PROC --+
>>-- IMPORT -- DATA --- FROM FileName -------------------------<<
                                  ( +- LOBSFROM = path1;path2; -+
>>--IMPORT --– FORM --– FROM FileName -------------------------------<<
            +- REPORT -+       ( +- LANGUAGE = ENGLISH/SESSION ------+

To import visual reports created in QMF for Windows:

>>-- IMPORT -- REPORT ObjectName -- FROM FileName ---------------------------------------<<
                                                ( +- COMMENT = Text -------------------+
                                                  +- CONFIRM = YES/NO -----------------+
                                                  +- LANGUAGE = ENGLISH/SESSION -------+
                                                  +- SHARE = YES/NO -------------------+                        
Parameter Description
ObjectName The name of the object to import into the database.
Note: For Cloudant queries, specify the full object key.
FileName The name of the file from which the object will be imported.
CONFIRM Specifies whether or not to display a confirmation dialog before replacing an existing object. If CONFIRM is not specified or is NO, the corresponding resource limit is used.
COMMENT Specifies a comment with the imported object. Enclose the text of the comment in quotes.
SHARE Specifies whether other users are allowed to use the imported object.
LANGUAGE Specifies whether a form is imported in English or in the current session language. A form that is imported in English can be run in any NLF session. A form imported in the session language can only be run in a session of the same language. The default value is provided by the DSQEC_FORM_LANG global variable.
ACTION Specifies whether the entire database table will be replaced or the new data will be appended to the existing table.
LOBSFROM The location to save the LOBs.
SPACE Specifies both the database name and the table space name to save the table in a particular database container and table space.
Note: The table space name that you specify must match the default table space name that is set for your user ID on the Save Data tab of the resource limits settings. If you have the permission to override the default table space name, you can specify any table space name to which you want to save the table. The permission to override the table space name is set on the Save Data tab of the resource limits settings.
Note:
  • database.tablespace is used for Db2® for z/OS databases.
  • tablespace is used for Db2 for LUW databases.
SPACE DATABASE Specifies only the database name to save the table in a particular database container with the table space created automatically under the name of the created table.
Note: The parameter is used only for z/OS databases.
ACCELERATOR Specifies the name of the accelerator that you want to use to save your data. The ACCELERATOR keyword can be up to 128 characters long. The ACCELERATOR keyword cannot be specified if the SPACE keyword is already specified for the command, unless the value of the DSQEC_SAV_ALLOWED global variable is set to 5. The default value for the ACCELERATOR keyword is taken from the DSQEC_SAV_ACCELNM global variable.

The ACCELERATOR keyword is supported only on Db2 z/OS servers that support IDAA.

ACCELERATORDATABASE Specifies the name of the accelerator database that you want to use to save your tables. The ACCELERATORDATABASE keyword can be up to 128 characters long. The default value of the ACCELERATORDATABASE parameter is taken from the DSQEC_SAV_ACCELDB global variable. If the DSQEC_SAV_ACCELDB global variable value is not empty, the database specified by the SPACE keyword is ignored. If the ACCELERATORDATABASE parameter value is not empty, the value of the DSQEC_SAV_ACCELDB is ignored.

Example

IMPORT QUERY FROM C:\Queries\query1.qry
IMPORT QUERY FROM C:\Users\Username\Desktop\Cloudant_query.clq
IMPORT QUERY rsbi:/.workspaces/Default/Cloudant/Cloudant_query
FROM C:\Users\Username\Desktop\Cloudant_query.clq