Importing query results from Excel files

You can import the content of an Excel file to the data source.

About this task

To import an Excel file:

Procedure

  1. From the main menu, select File > Import.
    The Import wizard opens.
  2. Select Excel File and click Next.
    The Excel File Import page of the Import wizard opens.
  3. To specify the file that you want to import:
    1. Click Browse next to the File name field.
    2. Select either *.xls or *.xlsx in the Open window.
  4. If the document that you want to import includes several Excel sheets, select one of the following options:
    One query with several result sets
    Select this option if you want to create a single query with multiple result sets from your Excel file.
    Several queries with one result set
    Select this option if you want to create a query with a single result set from each sheet in your Excel file.
  5. In the Sheets area, select the sheets that you want to import and click Next to specify the import options for each sheet.
  6. From the Sheet list, select the sheet of the Excel file you want to work with.
    Note: All import settings that you specify for the first Excel sheet are automatically applied to every other sheet that you are importing. You can then change the settings for each individual sheet.
  7. In the First row number field, type the row number of the Excel sheet that you want to be the first row in the result set.
  8. In the First column number field, type the column number of the Excel sheet that you want to be the first column in the result set.
  9. To limit the number of rows in the result set, select the Row limit check box and type the number of rows.
  10. To limit the number of columns in the result set, select the Column limit check box and type the number of columns.
  11. If you want to turn the first row of the Excel document into the column names of the result set, select the First row contains column names check box.
  12. In the Preview pane, you can track how each selection changes the layout of the result set.
  13. Optional: Repeat steps 6-12 for each sheet.
  14. Click Next to specify the structure of the table from the imported Excel file.
  15. From the Sheet list, select the sheet of the Excel file you want to work with.
  16. In the Field definitions area, select what columns to include in the result set by checking the check boxes to the left of the Field name column.
  17. To edit a column name, click a cell in the Field name column and enter a new name.
  18. To specify a different data type, click a cell in the Type column and select a data type from the list. Available options are the following:
    • INTEGER can be used to store signed whole numbers between -2 147 483 648 and 2 147 483 647.
    • BIGINT can be used to store large signed whole numbers between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807.
    • DOUBLE can be used to store large numbers with a floating decimal point.
    • VARCHAR is used to store variable-length string of characters like employee name.
    • BIT is an integer data type. Possible values are 1, 0, or NULL. The string value TRUE is converted to 1, empty strings are converted to NULL and other string values are converted to 0. Converting any numerical values to the BIT data type promotes any nonzero value to 1.
    • DECIMAL is used to store the fixed precision and scale numbers. This data type should be used for precise values, such as currency.
    • DATE is used to store a date only.
    • TIME is used to store a time only.
    • TIMESTAMP is used to store both a date and a time.
    Note: DATE, TIME, and TIMESTAMP data types support different format options that define how the values are displayed in the result set.
    Note: The supported ranges and the precision of values might vary depending on the database you use.
  19. In the Length field, specify a maximum number of characters for the VARCHAR type.
  20. In the Precision field, specify a maximum total number of digits for the DECIMAL type.
  21. In the Scale field, specify a maximum number of:
    • fractional digits for the DECIMAL type
    • digits in the fractional seconds part for the TIMESTAMP or TIMESTAMP WITH TIMEZONE type
  22. Optional: Repeat steps 15-21 for each sheet.
  23. Click Finish.

Results

The imported data is displayed on the screen in the form of one or several query result sets. For detailed information on working with query result sets, see the Managing query results topic.