Extract dataThe Data Extract tool allows you to easily create CSV files from an existing database. The Extract Data window can be accessed via the "Tools > Extract Data..." menu item in Cycle. It can also be accessed from the Feature editor by right-clicking and selecting the "Extract Data..." menu item.
Adding A Data Extract ModelAfter opening the Extract Data window, clicking "Add model..." will open a file browser to select a model. A Data Extract Model has the file extension .cycextract. Once a model has been added, it will automatically be copied to a folder named "DataExtractModels" in the currently open Cycle tab's resource directory. It can then be found in the "Select extract model" dropdown on the Extract Data window.
Extract data from a databaseEnter a new Dataset Name or select an existing dataset from the dropdown. Select the Data Extract Model from the dropdown for this extraction. JDBC or MOCA will be selected automatically based on your Data Extract Model. For JDBC databases, select the database type from the dropdown and enter the database name. Both MOCA and JDBC databases require entering the database host, username, and password containing the data to be extracted. The Input Parameters table at the bottom of the window allows you to enter in values to extract from the database. The Keys and Types are auto-created based on the Data Extract Model.
Once this information has been completed, click the "Extract data" button. Once the extract completes a dialog window will be presented detailing any errors with the extract or that the extract completed successfully. If successful, the resulting CSV file can be found in your currently open Cycle tab's resource directory in a folder with Dataset Name given in the Extract Data window. A .cycextractin file will also be created from the information entered into the Input Parameters table.
Using the datasetNow that the dataset has been created, use either of the following Steps to put it to use:
I execute MOCA dataset “<PATH_TO_DATASET>“ I execute SQL dataset “<PATH_TO_DATASET>“
When using these Steps, it will look for any filename beginning with “cleanup” and ending with “sql or msql”. If you want to validate something, a validation script will run if you have a filename that begins with “validate” and ends with “sql or msql”; this also applies to "load...".
Files are run in this order (none are required):
- Then CSVs are imported into Cycle (inserted into database)