After you have used DMC to Port your application to SQL you will have the possibility to use the RT engine to deploy your SQL tables and Transfer the TPS Data to these.
We explain here how to use the INI file - BOTH the INI and the REGISTRY options are demonstrated in details in our demo application
! PATH of the **DMC RT engine** ALWAYS read from REGISTRY ***DO NOT CHANGE***
RTPath = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Data Management Center RT','Directory Installation')
! PATH of the DMC RT engine **DATA SUBFOLDER** ALWAYS read from REGISTRY ***DO NOT CHANGE***
RTPathData = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Data Management Center RT','Directory Data')
! on a clean install the CU Key is not filled in by the RT installer
! read from LM Key which IS filled in by the SB Installer
IF ~RTPath
RTPath = GETREG(REG_LOCAL_MACHINE,'SOFTWARE\CGF\Data Management Center RT','Directory Installation')
! PATH of the DMC RT engine **DATA SUBFOLDER** ALWAYS read from REGISTRY ***DO NOT CHANGE***
RTPathData = GETREG(REG_LOCAL_MACHINE,'SOFTWARE\CGF\Data Management Center RT','Directory Data')
END
RTPathData = CLIP(RTPathData) & '\cgf_import\'
This INI file's content MUST be like this example :
[DB]
Driver=SQL Server
Server=SERVEUR-CGF\SQL_2005
User=sa
Pwd=xxxxxxx
Port=
DBName=DCT_Test
SQL_Type=SQL
Path=D:\Apps Tests\Dmc_Invoice_Demo\Dmc_Dctx_Scripts_dmc_invoice_demo.tps ! <- This is the path to the TPS Table containing all your SQL scripts
CreateDB=Yes ! or NO
MasterDB=master ! define ONLY if NOT MsSQL - MySQL or PostGre
[Path]
Project=D:\Apps Tests\Project_Invoice ! <- ONLY IF you want to CREATE all SQL tables or use the /DEPLOY parameter - otherwise leave empty)
We use variables to store settings and use those in code to define all
This is the code used to create this INI file :
PUTINI('Path','Project',DMC_LINK_PATH,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','Driver' ,DMC_GLO:DRIVER_D,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','Server' ,DMC_GLO:SERVER_D,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','User' ,DMC_GLO:USER_D ,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','Pwd' ,DMC_GLO:PWD_D ,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','Port' ,DMC_GLO:PORT_D ,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','DBName' ,DMC_GLO:DB_D ,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','SQL_Type',DMC_GLO:TYPE_D ,CLIP(DMC_RTPathData) & 'dmc_rt.ini')
PUTINI('DB','CreateDB','YES' ,CLIP(DMC_RTPathData) & 'dmc_rt.ini') ! ******** you can request the RT NOT to create the DB by using 'NO'
PUTINI('DB','MasterDB','master' ,CLIP(DMC_RTPathData) & 'dmc_rt.ini') ! you can define here the "MASTER" DataBase to use
! NOT required for MsSQL and MySQL and PostGreSQL (the RT "knows" which name to use)
! set to an EMPTY string for these servers
! This is the SQL scripts DMC generated File named Dmc_Dctx_Scripts_YourDctName.tps which you will find in the Folder MyDctName\Do_Not_Delete_Me
! This folder is accessible from within DMC after you run STEP 1 (DCTX parsing) using left navigation panel Documents/Port to SQL module
PUTINI('DB','Path' ,CLIP(DMC_SCRIPT_PATH) & '\scripts\Dmc_Dctx_Scripts_dmc_invoice_demo.tps',CLIP(DMC_RTPathData) & 'dmc_rt.ini')
Steps to CREATE the DataBase (/DB:1) :
Make sure the DataBase does NOT exist or you will get an SQL error during the process
This task can be called directly from command line as there is NOTHING to CHANGE to end-user machine settings as ALL is contained in the INI file
1. Create by hand or from your application an INI file named "dmc_rt.ini" and place it in this folder RTPathData
2. Call the RT engine like this : CLIP(RTPath) & '\dmcrt.exe /A:1 /I:1 /DB:1 /S:1'
This will start the RT SILENTLY with an AUTO CLOSE option informing it to use the INI file location to READ from and to perform a CREATE SQL DataBase task
You can use this exact command line if you want to test this Task on your DEV machine
Steps to CREATE all SQL Tables (/SCRIPT:1) :
Make sure the DataBase does exist or you will get an SQL error during the process (there is a DROP Table script included to protect you)
This task can be called directly from command line as there is NOTHING to CHANGE to end-user machine settings as ALL is contained in the INI file
1. Place anywhere you want the Dmc_Dctx_Scripts_YourDctName.tps table generated by DMC (it contains all your SQL scripts) and define this full path in the INI file
which you will find in the Folder MyDctName\Do_Not_Delete_Me .This folder is accessible from within DMC after you run STEP 1 (DCTX parsing) using left navigation panel Documents/Port to SQL module
2. Create by hand or from your application an INI file named "dmc_rt.ini" and place it in this folder RTPathData
3. Call the RT engine like this : CLIP(RTPath) & '\dmcrt.exe /A:1 /I:1 /SCRIPT:1 /S:1'
This will start the RT SILENTLY with an AUTO CLOSE option informing it to use the INI file location to READ from and to perform a CREATE all your SQL Tables task
You can use this exact command line if you want to test this Task on your DEV machine
Steps to CREATE the DataBase and CREATE all SQL Tables and Transfer all Data from TPS to SQL (/B:X /DEPLOY:1) :
Make sure the DataBase do NOT exist or you will get an SQL error during the process (there is a DROP Table script included to protect you)
This task cannot be called directly from command line on a client machine as there are values to change to client machine settings in your Profiles
1. Place anywhere you want the Dmc_Dctx_Scripts_YourDctName.tps table generated by DMC (it contains all your SQL scripts) and define this full path in the INI file
which you will find in the Folder MyDctName\Do_Not_Delete_Me .This folder is accessible from within DMC after you run STEP 1 (DCTX parsing) using left navigation panel Documents/Port to SQL module
2. Create by hand or from your application an INI file named "dmc_rt.ini" and place it in this folder RTPathData
3. Place anywhere you want the FOLDER generated by DMC after you use the EXPORT button in Projects & Profiles module
4. Open in that folder the INI file named "dmctr_settings.ini" generated and read the Project ID number to use
! EXAMPLE :
![Project]
!ID=6
! The VALUE to use throughout (your application) is "6"
5. Call the RT engine from your application using the same settings as for our demo application - command line will look like this : CLIP(RTPath) & '\dmcrt.exe /A:1 /I:1 /B:X /DEPLOY:1 /S:1'
This will start the RT SILENTLY with an AUTO CLOSE option informing it to use the INI file location to READ from and to perform a CREATE a DataBase then to CREATE all your SQL Tables and finally to Transfer all your TPS Data to the newly created SQL Tables
You can use this in command line if you want to test this Task on your DEV machine as NOTHING needs to be changed in the values contained in your Profiles