|
Online Tutorial
Click here to download sample DB Create a basic conversion job (One Dblink case)The basic conversion design and run process about dbf to dbfHow to convert a dbf file to another dbf file.See following:
Step 1: Create job file:You need create a job file first.1.Click the menu:[Edit]|[New job] in main window to open "Set job property" dialog box. 2.Enter job filename:"sample" in [Name]input box. 3.Click button [Ok], then enter job filename:"sample" in the "file save dialog" dialogbox, then click button [Ok] to open "Job design" window. 4.Click button [Ok], the created new job will be showed in job list box of main window.
Step 2: Create source data object:Now, create a source data object for reading data of DBF file named "source.dbf".1.Select job :"sample", which is created at last step in job list box of main window, then click menu [Edit]|[Design Job] to open "Job Desgin" window. 2.Click "DBF data object" button in tool bar, then click mouse left key in edit area, a DBF data object named "FieldDB1" will be created automatically and showed in edit area. 3.Edit FieldDB1 data object property. 1)Double click FieldDB1 data object to open the property dialog box, then enter name: "SourceDB" in [Name] input box. 2)Switch to [Database] sheet, then select "dBase" in [Select database type] combo box. 3)Click left button in [Path] edit box to open file browse dialog box, then locate "Source.dbf" target folder, then click [Ok]. 4)Click combo button in [Table name] combo box,to list all dbf file names of the path which list in [Path] input box, then Select "Source.dbf" in the file names list. 5)Switch to [Field ] page, then click [Import Field Definition], all fields field information of the table: "Source.dbf" will be listed automatically in grid. 6)Click [Ok] to finished set source data object property of job named "SourceDB". Step 3: Create target data object:1.Click DBF data object button in tool bar. Then click mouse left key in edit area, a DBF data object named "FieldDB2" is created automatically and showed in edit area. 2.Edit property of FieldDB2 data object. 1)Double FieldDB2 data object, to open "Set property of file table: FieldDB2" property dialog box, enter name "TargetDB" in [Name] input box. 2)Switch to [Database] page, choose "dBase" in [Select database type] combo box. 3)Click left button in [Path] edit box to open file browse dialog box, then locate "Target.dbf" file folder, then click [Ok]. 4)Click combo button in [Table name] combo box,to list all dbf file names of the path which is listed in [Path] input box, then Select "Target.dbf" in the file names list. 5)Switch to [Field ] page, then click [Import Field Definition], all field information of the table named "Target.dbf" will be listed automatically in grid. 6)Click [Ok] to finished set source data object property of job named 'TargetDB'. Step 4: Create dblink:1. Click [create dblink] button in tool bar, click mouse left key in SourceDB object and drag into TargetDB object, then release mouse left button, a new db link will be created and named "DBLink1" by "SourceDB" as source and "TargetDB" as target. 2. Double db link object, to open property dialogbox of the dblink, enter new name: "SampleDBLink" in [Name] input box. 3. Click button [Ok] to finish setting property of dblink named "SampleDBLink".
Step 5: Set field map relation:1.Double SampleDBLink dblink object to open property dialogbox of the dblink. 2.Click button [Field mapping] to open "Set SampleDBLink Fields mapping" window. Left side of the window display SourceDB field list, Right side of the window display TargetDB field list. 3.Press mouse left key in field :"PROGJCT" in SourceDB field list, then drat into TargetDB field list 'ID' , then release mouse left key, character string "PROGJCT" will be pasted automatically to edit box in left of field named "ID" as data source of field "ID" that is named "SourceDB.PROJECT",.It expresses a field variable that data object name is SourceDB and field name is PROJECT. 4.According to setp 3, create source field named "SourceDB.PROJECT" for field named: "CONTID" of "TargetDB" table. 5.Click button [Ok] to finished seting field map relation of dblink named DBLink1. 6.Click button [Ok] to finished seting property of dblink named:DBLink1.
Step 6: Set update mode of dblink:1.Double click Dblink object named "DBLink1" in edit area, to open a property dialog box of the Dblink object. 2.Cchoose "Append and Update" in Update mode combo box in [General] page. 3.Click button [Ok] to finished seting property of Dblink named "DBLink1". 4.Click button [Ok], exit job desing window. So far, you have finished a designing flow of a basic data transformation job.
Step 7: Run job:1.Choose the new job named "Sample" in job list box of main interface. 2.Choose dblink named "SampleDBLink" in the list box of dblink. 3.Click menu [tool]|[Preview import data], to open "Preview import data" window,conversion result will be displayed. 4.Exit preview window, and then press "F5" key, job will start to run and appended or updated data to Target.dbf.
Added calculation functionStep 1: Define local variable of dblink.1.Choose job named "Sample" in job list box of main interface, then click menu [Edit]|[Design Job]. 2.Double click dblink object named "SampleDBLink",to open property dialog box of "SampleDBLink". 3.Switch to [Define Varlist] page, enter the following variables in the variable sheet:
Step 2: Add filtration conditionSwitch to [Convert condition] sheet, enter the following text in [filter Condition] edit box: void( SOURFLD:=Trim(FILEDB1.PROJECT), ID:=Trim(Upper(SubS(SOURFLD,1,Pos('.',SOURFLD)-1))), NAME:=SubS(SOURFLD,Pos('.',SOURFLD)+1,1000), Iif(SubS(ID,2,2)='00',CONTINENTNAME:=NAME,COUNTRYNAME:=NAME) ) + SubS(ID,2,2)<>'00'
Step 3: Add calculation formula to each field of target table.1.Switch to [General] sheet, then click button [Field Mapping],to open "Set dblink mapping" window. 2.Double click slowly the left area of "ID" field or click continuously mouse left key three times in field list of TargetDB, then click button which appeared in right of the edit box,to opened "Expression Editor" dialog boxs. 3.Enter text "ID" in edit box. 4.Repeat step 2 and step 3, enter calculation expression of target field:
6.Click button [Ok] to finish job design.
Setp 3:Run job.1.Choose job named "Sample" in job list of main interface.2.Choose dblink named "SampleDBLink" in the dblink list. 3.Click menu [tool]|[Preview Import Data] to open "Preview import data" window,conversion result will be displayed. 4.Exit preview window, and then press "F5" key, job will be runing and data is appended or updated to Target.dbf. Debug transformation job.You can debug one dblink of transformation job.Selected transformation job named "Sample" as debugging object, following the next step to debuging:
Step 1: Set break pointBreak point of dblink is only valid in debug precess.1. Choose the job named "Sample" in job list of main window. 2. Choose dblink named "SampleDBLink" in the dblink list. 3. Click menu [Edit]|[DBLink Property], to open property dialog box of DBLink. 4.Switch to [Convert Condition] sheet, enter the follow text in [Pause Condition] edit box:: ID='200' 5. Click button [Ok] to finish setting break point of 'SampleDBLink' dblink. Step 2: Set debug parameter.You can set debug mode:stop parameter, pause parameter or warning parameter when reading the place of specified source record.1. Choose dblink named "SampleDBLink" in dblink list of main interface. 2. Click menu [Run]|[Debug], to open debug window. 3. Choose dblink named "SampleDBLink" in dblink list of debug window. 4. Click button [Debug Parameter] in tool bar to open "Set Debug Mode" dialog box. 5. Set pause parameter, choose "pause after rows", and enter records: 5 in edit box [Rows].
Step 3: Start debug.Run step by step1.Choose dblink named "SampleDBLink" in dblink list of debug window. 2.Click button [Step] in tool bar ,could view current calculation data in [debug window]. Start debug 1.Choose dblink named "SampleDBLink" in dblink list of debug window. 2.Click button [Run] in tool bar, source data whill stoped when source data moving to the fifth record, then click button [Step], you can view current calculation data.
Deal with wrong data.Notice: wrong data can not be processed when target data object type is Oracle or DB2, and that can be processed when target data object type is ODBC or DBF.Reprocessing of wrong data is simply, so demo is left out. Please use the following methods: 1. choose a dblink had wrong data in dblink list of main window. 2.Switch to [Error Data] sheet in watch area of main window. 3.Click right mouse key in data grid of [Error Data] sheet, choose menu [Translate Error Data] in pop-up menu to open "Manage Error Data" window of the selected dblink. 4.Wrong data show in Data grid "manage error data" window, you can modify data by hand, then click button [Run] in tool bar, DBPut will make corrected data as source data, then convert them into target database.
|
Copyright 2002-2006 yuansan. All rights reserved. support@dbput.com