Step TWO (Application parsing)

Navigation:  Port to SQL >

Step TWO (Application parsing)

Previous pageReturn to chapter overviewNext page

Application

 

Ok, it's nice to know the Dictionary is all set, but what about your Clarion Application?  All those changes to the Dictionary lead to numerous changes to the Application not to mention all your custom embeds and Included CLW code.  No worries, DMC will take care of all that for you as well.

 

DMC intelligently parses your TXA and replaces the old table, key and column names with the new SQL ones throughout your TXA and included CLW files.  This is a smart replacement.  It doesn't just do a blanket search/replace.  DMC incorporates context based intelligence tools to make sure it knows the difference between table/key/column names and function and procedure calls of the same name.  You'll be amazed how it quickly converts your application to SQL.

 

Lets walk through the screens for this process.

 

Normally, that would be enough to make anyone smile, but DMC takes the process several steps further.  DMC will actually evaluate your code for numerous SQL incompatibilities.  For example, Loop Until EOF(Customer) works fine for a TPS file, but has no equivalent for SQL.  DMC does not re-write your code, but it will add a comment to this line of code informing you of the problem and suggest alternate ways to accomplish the same task in SQL.  When you compile your new SQL application it will return an error so you can see where your code is "broken" and you can decide how you would like to fix the problem.  Here the suggestion would be to change that line to Loop Records(Customer) times.  That makes it easy to fix the problem and get your application up and running quickly.

 

The best thing is that you can actually "fix" problems like that in your TPS application by using a variety of DMC Control Variables.  These variables are added as Comments to your existing code and tell DMC when to change your code to a comment and your comments to code.  Here's how it works.  In your TPS application you find the offending code (typically in an embed):

 

 Loop Until EOF (Customer)

 

and change it like this:

 

 Loop Until EOF(Customer)                                   ! DMC_Comment_Line

 ! Loop Records(Customer) times                         ! DMC_UnComment_Line

 

You TPS program will continue to work they way it always did, but when you re-Port to SQL the DMC magic is applied.  The resulting TXA file will change the first line to a comment and elevate the second line to be working code.

 

 ! Loop Until EOF(Customer)                                 ! DMC_Comment_Line

 Loop Records(Customer) times                           ! DMC_UnComment_Line

 

Now when you import that TXA into a new application the SQL version will compile and run without further action on your part.  You only need to maintain one Application and you can Port to the different flavors of SQL at any time.

 

DMC Control Variable (always preceded by a "!")

 Action taken during Port Application to SQL in DMC

! DMC_Comment_Line

Add a "!" at the start of this line

! DMC_UnComment_Line

Remove the "!" from the start of this line (only the first "!" affected)

! DMC_Comment_Block

Add a "!" to the start of every line until it reaches a ! DMC_Comment_Block_End

! DMC_UnComment_Block

Removed the "!" from every line unti it reaches a ! DMC_Uncomment_Block_End

 

If you want to get very specific, you can add a SQL version to each of the above commands to support multiple types of Port to SQL conversions.  For example, if you want different code for Oracle than for Mimer, you simply add the appropriate version to the command.

 

 ! MyFunction ('Oracle',MyDriver)        ! DMC_Uncomment_Line_"Oracle"

 ! MyFunction ('Mimer',MyDriver)        ! DMC_Uncomment_Line_"Mimer"

 

If you Port to SQL in DMC using "Oracle" as your SQL Server Type it will activate only the first line.  Then, you can Port to SQL again with the SQL Server Type of "Mimer" and it will activate only the second line.  Fix it once in your TPS code and use DMC to Port when necessary.  The accepted values for the version switch are:  "SQL", "MySQL", "Oracle", "PostGre", "Pervasive", "SQLAny", "FireBird", "DB2" or "Mimer"  (only one “<version>” can be specified and it is CASE SENSITIVE and the quotes are required as well).

 

Show me the next step.