Applicable Versions: 2.01.0152 Onwards
NB. Version 6.00.0000 and above introduced queries that can import data from a file (including CSV files), offering a simpler import mechanism.
This article uses business logic functions. For more information on creating business logic functions, see "Can I create a query that runs a Progress function on the server to retrieve data?".
First of all you need to add the csv import (downloadable below) business logic procedure to the super procedure stack of your AppServer. Follow the steps in "Can I create a query that runs a Progress function on the server to retrieve data?"on how to add the csv import (downloadable below) business logic procedure to the super procedure stack.
Once you have done this, follow the steps below to create a subject based on your CSV file.
- Open the subject wizard to create an new subject.
- Enter a name and description for your subject and press Next
- Select the System you want to create your subject against, and press Next
- Select Create business logic subject, then select CSVToTT from the drop down list. (NB. If CSVToTT does not appear in the list, check you have followed the steps in "Can I create a query that runs a Progress function on the server to retrieve data?" on how to add the csv import (downloadable below) business logic procedure to the super procedure stack
- Enter an appropriate value for each of the 6 input parameters for CSVToTT (see table below for details).
- Press next to confirm all 6 of these input parameters should be kept as fixed values when a user creates a query from this subject.
- Complete the subject wizard.
- Save your changes.
- Create queries using the subject.
The table below details the input parameters CSVToTT requires:
Parameter | Description |
filename | The full pathname of the CSV file that contains the data. The business logic is executed on the AppServer, so the pathname should be the pathname as seen from the AppServer session. |
autoGenerateTypes | If you check this checkbox, the business logic procedure will endeavour to automatically generate the types of the fields imported into the temp table. If you do not check this, you must provide a comma separated list of Progress data types for each field. |
firstColumnContainsHeadings | Check this option if the first line of the CSV file contains column headings. If you do not check this option, you must supply a comma separated list of column headings (field labels) in the column headings parameter. |
ColumnHeadings | A comma separated list of column headings (field labels). Only required if firstColumnContainsHeadings is not selected. |
ColumnTypes | A comma separated list of Progress data types for each field. Only required if autoGenerateTypes is not selected. |
DateFormat | Enter dmy or mdy to specify the date format used in the csv file. If left blank, the default format for the AppServer session will be assumed. |