Navigation:  Port to SQL >

Step Four (Putting it all Together)

Previous pageReturn to chapter overviewNext page

 

 

Once DMC has completed the "Dictionary" step of Port your Application to SQL you can build your new Dictionary.  All you need to do is tell Clarion to Create a NEW dictionary. Do not try to import directly into the original dictionary.  Clarion works with identifiers stored in the Dictionary.  If you import directly back into the original dictionary it will get very confused when you import the new application TXA!  Once you have the New Empty Dictionary open, simple click on the down arrow (shown below) and Select Import Dictionary From Text and open the  new DCTX that DMC created.  It will be named starting with "SQL_Dmc_Dctx_" then your original Dictionary name with the extension .DCTX.

 

 

You can look through all the changes, or just save the new Dictionary.  Now is a good time to consider if you want to simply create a SQL only version of your application or if you want to create a "Dual" application that supports both TPS and SQL.  The SQL only version is easy enough to understand.  Give your "new" SQL version Dictionary the same name as the original Dictionary and create a new application from the TXA and you're done.

 

* NOTE:  The name of the Dictionary is important because the new TXA directs Clarion to use the Original Dictionary name.  If you want to save the SQL dictionary with the different name, you will need to open the TXA and manually change the name of the Dictionary.

 

The Dual application highlights the power of the DMC Port to SQL process.  The Dual Application is easy to create in Clarion7 or Clarion8, but is much more challenging in C6 (Requires a multi-DLL solution).

 

Next, in the same folder, use Clarion to create a New Application from TXA using the new (SQL) dictionary.  Select the new TXA file which is named Dmc_DCTX_ <your application name>.txa.  Clarion will take care of the rest of the linking to the dictionary.

 

Open the Original Dictionary and Import the SQL tables from the new (SQL) Dictionary to the original (TPS) Dictionary.  Since DMC modified all the Table names for you they will peacefully coexist.  * Keep the Original App and DCT in another folder for all your modifications and program changes.

 

Since DMC modified the names of your procedures, as well as the tables, keys and columns you can create a dual application simply by copying and pasting the procedures from the new to the original application, or you can use Import from Application in Clarion to combine the two applications.

 

It's import to note that you will have matching duplicates in the dual application.  For example, your Dictionary will have both a Customer table and a Sql_Customer table.  Your application will have BrowseCustomer as well as Sql_BrowseCustomer procedures.  DMC clones everything and renames it so there are no conflicts.  All your procedures will be there unless you manually direct DMC not to rename them by add the token DMCNoRename or DMCSkip in the Description field of that procedure in Clarion.

 

Adding DMCNoRename will parse the procedure, but its name will not be changed.  This is particularly useful for template added procedures.

 

Adding DMCSkip will cause DMC to ignore the procedure completely.  This is useful when you have a function that contains no references to tables or columns that will continue to work properly in TPS or SQL without any changes.

 

Executing the Dual Application.  For your convenience we provide a custom sample TXA (you'll find it in your Destination folder (named DMC_DCTX_ABC/LEG_TpsSqlSwitch_Procedure.txa) that lets you switch between the TPS version and SQL version of your Dual App.  Simply import this TXA into your dual application then make DMC_GlobalSwitch your new First Procedure in your Application's Global Properties.  You may want to control that switch based on your own licensing and subscription plans instead.  With the sample code, if you select TPS the program will run the TPS linked procedures.  If you select SQL you will simply run the Sql_ procedures.  The look and feel remain the same.