PreviousDDF Builder User's Guide (4.0 revision 1) Next

DDF Builder Tasks

Show this topic in Library frames

This section explains the tasks that you perform with DDF Builder. The tasks are divided into the following categories:

Category
Description
Orient you to the overall use of DDF Builder
Tasks Initiated from Data Sources Explorer
Allow you to access editors, views, and wizards
Scenarios
Demonstrate how to combine tasks to achieve a specific result

General Tasks

General tasks apply to the overall use of the tool.

To start DDF Builder:

  1. See How Do You Start DDF Builder? .
  2. Follow the steps for your operating system.

To access DDF Builder documentation:

  1. See How Do You Access the Documentation? .
  2. Follow the steps for the documentation in which you are interested.

To set preferences for SQL Editor, Data Grid, or Text Output:

  1. Click Window 4 Preferences.
  2. Expand the Pervasive node.
  3. Click on the desired node: Data Grid, SQL Editor, or Text Output.
  4. Specify the preferences.
  5. Click Apply or OK.

To see added or deleted nodes in Data Sources Explorer

  1. Right-click on the node for which you want to see the addition or deletion.
  2. Click Refresh.
  3. The context of the Refresh command applies to the node from which you invoke it. If you want to refresh all nodes in Data Sources Explorer, execute the command from the Engines node (the "top" of the tree).

Tasks Initiated from Data Sources Explorer

Most tasks in DDF Builder are initiated by selecting a command relevant to a node in Data Sources Explorer. The commands invoke an editor, a view, or a wizard.

Click an area of interest in the following list to determine the commands pertaining to that area:

Scenarios

Task scenarios explain how to combine several activities to achieve a specific result.

Scenario 1

Your goal is the following:

Complete the following steps, which assume a default installation of Pervasive.SQL.

Create the New Btrieve File and SQL Table at the Same Time
  1. Start DDF Builder if it is not already running.
  2. In Data Sources Explorer, expand the following nodes: Databases, DEMODATA, Data Paths, C:\PVSW\DEMODATA, CLASS.MKD.
  3. Right-click Class (the SQL table for CLASS.MKD).
  4. Click Copy SQL Definition.
  5. Click Next and ensure that Target Server is your local machine where you are running the database engine (the default).
  6. Click Next and select "DEMODATA" as the Target Database.
  7. Click Next and type "Myclassfile" as the name for the Target Table.
  8. Click Finish.
  9. Right-click the data path C:\PVSW\DEMODATA then click Refresh.
  10. Notice that MYCLASSFILE.MKD is listed as a Btrieve file and that it has an associated SQL table named Myclassfile. By default, DDF Builder adds a file extension of "mkd" to the Btrieve file.

Get the Data
  1. In Data Sources Explorer, right-click Class (the SQL table name for CLASS.MKD) then click Export Data.
  2. For Target Table, type "C:\PVSW\DEMODATA\Classexport.dat" and click Next.
  3. Click Next to accept the comma delimiter.
  4. Click Finish.
  5. In Data Sources Explorer, right-click Myclassfile then click Import Data.
  6. Browse to Classexport.dat and select it as the name for the Source File.
  7. Click Next.
  8. Click Next to accept the comma delimiter.
  9. Click Next to import all columns of data.
  10. Ensure that Target Server is your local machine where you are running the database engine (the default)
  11. Select "DEMODATA" as the Target Database then click Next.
  12. Select "Myclassfile" as the Target Table then click Finish.
  13. Double-click Myclassfile to view the formatted data.

  14. You have achieved your goal for the scenario. Optionally, you may delete the new file now that you no longer need it.

    Right-click Myclassfile.mkd then click Delete.

    This removes the definition of the file from the DDFs but not the file from physical storage. If you want to delete the physical file, perform the deletion action at the operating system.

Scenario 2

Your goal is the following:

Complete the following steps, which assume a default installation of Pervasive.SQL.

Obtain an Existing Btrieve File for the Scenario

If you were performing this scenario outside of a learning exercise, you would already have a Btrieve file.

  1. At the operating system, create a temporary directory.
  2. For convenience of discussion, these steps assume that the directory is C:\scenario_test.

  3. Copy C:\PVSW\Demodata\COURSE.MKD to C:\scenario_test and rename the file to BTRTEST.MKD.
Create a Database for the Scenario

If you were performing this scenario outside of a learning exercise, you would already have a database.

  1. Start DDF Builder if it is not already running.
  2. Right-click the Database node then click Add Database.
  3. For Database Name, type "Scenariotest."
  4. For Location, type "C:\scenario_test" then click Finish.
  5. By default, the Add Database wizard creates DDFs for the new database if none exist in the location you specify.

  6. Expand Scenariotest under the Database node.
  7. For Scenariotest, expand all nodes under Data Paths.
  8. Notice that BTRTEST.MKD is listed as a Btrieve file. This is the file for which you will define SQL metadata.

Define the Table Fields

If you were performing this scenario outside of a learning exercise, you would need to know the size and data types of the fields.

  1. In Data Sources Explorer, right-click BTRTEST.MKD then click Create Table Definition.
  2. The SQL Table Editor starts. You should see something similar to the following:

    Notice that "field_0" and "field_2" have defined data types. This indicates that they are defined as keys in the Btrieve file. Click the CHAR(7) cell for "field_0." The editor informs you that you cannot change the data type because a key is defined for that column.

  3. Double-click in the cell "field_0" and change the field name to "Name."
  4. Double-click in the cell "field_1" and change the field name to "Description."
  5. Click the Insert button to create a new row below "Description."
  6. The field name for the inserted row is "<field name>."

  7. For the "Description" field, click the box in the "Null" column.
  8. For the "Description" field, double-click in the appropriate cell and specify the following values:
    • Size: 50
    • Btrieve Type: Char
  9. For the "<field name>" field, click the box in the "Null" column.
  10. For the "<field name>" field, click in the appropriate cell and specify the following values:
    • Field: Credit_Hours
    • Offset: 59
    • Size: 2
    • Btrieve Type: Unsigned Binary
  11. Change the field name of "field_2" to "Dept_Name."
  12. For the "Name," "Description," and "Dept_Name" fields, click the box in the Incl column.
  13. Note that you must check mark the "Incl" (Include) column for each field that you want to include in the SQL definition.

    The SQL definition should look like the following:

  14. Click Apply to save the definitions.
  15. Note that, if you wanted, you can change the name of the table on the Table tab before you click Apply. Once you save your changes, you cannot change the table name in SQL Table Editor.

Preview the Data and Access It With SQL
  1. Click the Preview tab.
  2. Notice that the SQL metadata allows you to view the data in a human readable format.

  3. In the SQL Table Editor tab, click the "X" to close the editor.

  4. In Data Sources Explorer, expand BTRTEST.MKD and notice that an SQL table now exists for it.
  5. Double-click the SQL table name, BTRTEST.
  6. SQL Editor starts and executes a "SELECT *" statement on the table.

    You have achieved your goal for the scenario. Optionally, you may delete the new database now that you no longer need it.

    Right-click Scenariotest then click Delete.

    This removes the definition of the database from DDF Builder but not from physical storage. If you want to delete the scenario_test directory, do so at the operating system.


Chapter contents
Publication contents

Prev topic: The DDF Builder Graphical User Interface
Next topic: