Infocenter

Database On-Demand File Upload

Database On-Demand provides an interface for uploading files from a client to a host database. The Database On-Demand File Upload feature is entirely different than the iSeries File Upload feature. The advantages of the File Upload feature include:

The File Upload feature also differs from the Database On-Demand SQL Wizard in that the wizard allows you to work with records in a host database, while File Upload allows you to work with entire files in a host database.

A set of tabs guides you through the process of building and executing a valid File Upload statement. The tabs include:

Logon

Click the Logon tab to connect to the target database. All fields are required.

Enter the required information and Click Connect to open a connection to the host database.

Notes:

After connecting, the connect button is replaced by a Disconnect button, which allows you to disconnect from the database. Also, the following set of tabs are added to the Logon tab:

Table

Click the Table tab to specify the tables you want to access in your File Upload statement, and the type of File Upload statement that you will generate.

  1. Select the File Upload statement type you want to use. Valid statement types include:


  2. If you are creating a table, type a name for the new table, and select whether to use the field descriptions from a reference table, or from a saved SQL statement. Choose either the table or the saved SQL statement you want to access from the list. If you are making changes to a table, choose Replace, Append or Update and select the table the data is replacing, appending to or updating.


  3. Click Next.

Click View schema(s) to add tables from additional schemas. A schema is similar to a database or library. For iSeries schemas, the defaults are what is in the default library list for the user profile.

Click Refresh to update the list of tables that are displayed. New tables that were added to the schema are displayed in the Table list; deleted tables are removed. Refresh does not reset any selections that have been made.

When you finish with the Table tab, click Next.

Key Columns

This tab displays only if you select the File Upload type "Update" on the Table tab. The available columns window contains the list of the defined columns in the host database table that you can use to uniquely identify the records you want to update.

  1. Select one or more columns from the Available columns list.

  2. Use the Add<< and >>Remove buttons to move column names from one list to another.

If the database table you selected already has key columns defined, the key fields are automatically selected from the available columns window and placed in the selected columns window.

You must select the correct columns that uniquely identify the records you want to update, or the update operation results in inconsistent data.

When you finish with the Key Columns tab, click Next.

File

Click the File tab to specify the name of the file to upload. The file type is automatically selected if the file extension is recognized. File Upload supports the following file types:

txt (ASCII)Plain text format
csvColumns (fields separated by commas)
wk1Lotus 1-2-3 format
xls (BIFF3)Microsoft Excel 3.0 format
xls (BIFF4)Microsoft Excel 4.0 format

Database On-Demand File Upload cannot support the latest Lotus 1-2-3 or Excel file formats because of the layout and the native methods needed read these files types.

You can save the File Upload statement you have created or updated by clicking Save Statement.

You can upload your file by clicking Run Statement.