Professional Documents
Culture Documents
Data Exchange Wizard User Manual
Data Exchange Wizard User Manual
Contents
Contents....................................................................................................................................... 2 1. Introduction ............................................................................................................................. 4 2. Requirements........................................................................................................................... 4 3. Key features............................................................................................................................. 5 Data Import.............................................................................................................................. 5 Data Export.............................................................................................................................. 6 4. Data Exchange Wizard Architecture....................................................................................... 7 5. Importing Data ........................................................................................................................ 7 5. Importing Data ........................................................................................................................ 8 Working with Data Exchange Wizard..................................................................................... 9 Welcome page ..................................................................................................................... 9 Load Configuration ............................................................................................................. 9 Operation Type.................................................................................................................. 10 Data Source Type .............................................................................................................. 10 Text Files........................................................................................................................... 11 File Format ........................................................................................................................ 11 Cross Table........................................................................................................................ 12 Excel Files ......................................................................................................................... 12 ODBC Data Source ........................................................................................................... 13 Source is Table(s).............................................................................................................. 14 Source is a Select Statement.............................................................................................. 15 Query Builder .................................................................................................................... 16 Mapping Screen Overview................................................................................................ 19 Main tool bar ..................................................................................................................... 20 Source tool bar................................................................................................................... 20 Mapping panel................................................................................................................... 20 SQL Statements ................................................................................................................. 21 Logging Options................................................................................................................ 22 Data Preview ..................................................................................................................... 23 Ready................................................................................................................................. 24 Processing Data ................................................................................................................. 25 Log..................................................................................................................................... 26 Rejected Records............................................................................................................... 27 Save Configuration............................................................................................................ 28 Data Mapping .................................................................................................................... 29 Auto mapping .................................................................................................................... 29 Checking Mapping ............................................................................................................ 30 How to clear mapping ....................................................................................................... 31 Loading data from the Cross table .................................................................................... 32 Performing Calculations.................................................................................................... 34 Filtering Data..................................................................................................................... 35 Updating/Deleting Records ............................................................................................... 37 6. Target Database Specific Parameters .................................................................................... 39 MS SQL Server parameters............................................................................................... 39 Oracle parameters.............................................................................................................. 39 7. Exporting Data ...................................................................................................................... 40 Source Connecion.............................................................................................................. 41
Version 3 Issue 2 DB Software Laboratory
2 of 59
Data Exchange Wizard User Manual Source is Table(s).............................................................................................................. 42 Source is a Select Statement.............................................................................................. 44 Query Builder .................................................................................................................... 45 Logging Options................................................................................................................ 46 Ready................................................................................................................................. 47 Processing Data ................................................................................................................. 47 Log..................................................................................................................................... 48 Save Configuration............................................................................................................ 48 8. Import Functions ................................................................................................................... 49 String Functions .................................................................................................................... 49 Numeric Functions ................................................................................................................ 51 Date Functions....................................................................................................................... 52 Conversion Functions............................................................................................................ 53 Miscellaneous Functions ....................................................................................................... 54 9. Date formats .......................................................................................................................... 55 10. Using Command Line Interface .......................................................................................... 56 11. Support Procedure ............................................................................................................... 57 12. License Agreement.............................................................................................................. 58
Version 3 Issue 2
DB Software Laboratory
3 of 59
1. Introduction
Data Exchange Wizard is a easy to use tool designed to help end user to import and export data between different various data sources and targets.
2. Requirements
Below is a List of Software that must be installed before installation of Data Exchange Wizard: Software Microsoft Windows MDAC SQL ODBC driver Oracle Client Version 98 or higher 2.6 or higher 2000.81.9041.40 7.3.4 or higher Notes Part of OS on W2K, XP Part of OS on W3K, XP Provided by Oracle
Only to work with MS SQL Server Only to work with Oracle database
Note: Depending on the user requirement you may or may not need to have all the software components installed
Version 3 Issue 2
DB Software Laboratory
4 of 59
3. Key features
Data Import Data targets: Oracle 7-9i database (using OCI API) SQL server 7- 2000 (using BCP API) ODBC source (Using ODBC API)
Data sources: Also: Text files Any ODBC source Multiple Files or Tables
Great performance - hundreds of records per second Comprehensive Error log Rejected records file Integrated Expressions builder Data Preview
Allows the user to perform calculation during the loading process such as fields splitting, concatenations, data formatting, and ability to load cross tables. Oracle There are two ways of loading available: Oracle direct path loading Conventional path SQL server This software uses the same API as Microsoft DTS service.
Version 3 Issue 2
DB Software Laboratory
5 of 59
Data Export Data Sources: Oracle 7-9i database (using OCI API) SQL server 7- 2000 (using BCP API) ODBC source (Using ODBC API) Multiple tables
Version 3 Issue 2
DB Software Laboratory
6 of 59
Oracle
OCI API
Flat Files
BCP API
SQL Server
ODBC
ODBC API
ODBC
Data Sources
Data Targets
ODBC
SQL Server
Oracle
Flat Files
Data Sources
Version 3 Issue 2
Data Targets
DB Software Laboratory
7 of 59
5. Importing Data
Calculation?
No Errors?
Reject If Error
Reject Record
Version 3 Issue 2
DB Software Laboratory
8 of 59
Data Exchange Wizard User Manual Working with Data Exchange Wizard To start Data Exchange Wizard Click Start -> All Programs -> DB Software Laboratory -> Data Exchange Wizard -> Data Exchange Wizard Welcome page This is how Data Exchange Wizard looks like once it is started Press the Next button to proceed to the next page
Load Configuration You may choose to open previously created configuration or open existing one Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
9 of 59
Data Exchange Wizard User Manual Operation Type Select appropriate operation type Press the Next button to proceed to the next page
Data Source Type Select data source type and Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
10 of 59
Data Exchange Wizard User Manual Depending on your choice you will see one of the following pages Text Files Select File name and if you want to load data from several files specify mask Data Exchange Wizard will search for files where selected file is located Press the Next button to proceed to the next page
File Format Select File format and fill in Text Qualifier and Delimiter Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
11 of 59
Data Exchange Wizard User Manual Cross Table Select appropriate options (for more information see Loading data from a cross table) Press the Next button to proceed to the next page
Excel Files Select File name and if you want to load data from several files specify mask Data Exchange Wizard will search for files where selected file is located Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
12 of 59
Data Exchange Wizard User Manual Select Excel Sheet and Press the Next button to proceed to the next page
ODBC Data Source Fill in Data Source Name, User Name, Password Test Connection and Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
13 of 59
Data Exchange Wizard User Manual Specify whether your Source is table or Select Statement Press the Next button to proceed to the next page
Depending on your choice you will see one of the following pages Source is Table(s) Select table(s) you want lo load data from or alternatively specify a mask to find tables Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
14 of 59
Data Exchange Wizard User Manual Source is a Select Statement Fill in a Select Statement you want to load data from Or alternatively use Query builder to generate Sql Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
15 of 59
Query Builder
Version 3 Issue 2
DB Software Laboratory
16 of 59
Data Exchange Wizard User Manual On this step you should enter all necessary settings to connect to the target database First select Database Type, than fill in Server name for MS Sql Server Connection TNS Name for Oracle Connection DSN Name for ODBC Connection Fill in User Name and Password Fill in Database name for MS Sql Server Connection Fill in Table name to load data into Test connection to make sure it is working Fill in Sql Statements Separator and Press the Next button to proceed to the next page Note: For more information see Target Database specific parameters
Version 3 Issue 2
DB Software Laboratory
17 of 59
Data Exchange Wizard User Manual Select Appropriate Transformation type Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
18 of 59
Mapping Panel
Field Width
Version 3 Issue 2
DB Software Laboratory
19 of 59
1 2 1. 2. 3. 4.
3 4 Refreshes fields list from the database Checks script for the errors Allows user to clear field mapping Hides mapping panel
2 3 1. 2. 3. 4. 5. 6. 7.
Refreshes Source data Adds new column Deletes last column Auto map the source fields to the target fields Filter Sources file name/ table name Number of records to show in grid
Mapping panel Mapping panel is designed to provide user with all information related to the mapping of one particular field. There are two ways of mapping: direct and through calculations.
Mapping type
Source Field
Alternately you may hide Mapping panel and use grid to perform mapping.
Version 3 Issue 2
DB Software Laboratory
20 of 59
Once mapping is completed Press the Next button to proceed to the next page Note
SQL Statements Data Exchange Wizard provides functionality to perform SQL statements before and after data import or export. Note: In order to Execute several SQL statements user must specify SQL delimiter No select statements allowed
Version 3 Issue 2
DB Software Laboratory
21 of 59
Data Exchange Wizard User Manual Logging Options Check default options and Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
22 of 59
Data Preview This is how data will look like once it is imported into the database Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
23 of 59
Ready We are now ready to load data into the database Check the information presented and Press the Next button to start loading data
Version 3 Issue 2
DB Software Laboratory
24 of 59
Data Exchange Wizard User Manual Processing Data At this step data is being loaded into the database You may stop import any time by clicking Stop Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
25 of 59
Log Once data is loaded it vital to check the log file for any errors Press the Next button to proceed to the next page.
Version 3 Issue 2
DB Software Laboratory
26 of 59
Rejected Records Examine Rejected records Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
27 of 59
Save Configuration Now when import is completed end user can choose to save the configuration Click finish to close Data exchange wizard.
Version 3 Issue 2
DB Software Laboratory
28 of 59
Data Exchange Wizard User Manual Data Mapping Select Fist field in the Data Target fields list and drag and drop it above [CUSTOMERID] field.
You may change field mapping by using mapping panel at any time.
Auto mapping If the Data Source and Data Target have got the same fields names you may use Auto map feature. Click , Click yes.
Version 3 Issue 2
DB Software Laboratory
29 of 59
Data Exchange Wizard User Manual Checking Mapping Once mapping is completed it is important to check it by clicking button.
Version 3 Issue 2
DB Software Laboratory
30 of 59
How to clear mapping Click . Click on the field you would like to clear
Version 3 Issue 2
DB Software Laboratory
31 of 59
Loading data from the Cross table Let us say we have table like the following in the database:
No 1 2 3 4 5 Field CUSTOMERID YEAR MONTH PRODUCTID AMOUNT Data Type CHAR DECIMAL DECIMAL DECIMAL DECIMAL
And a text file like the one below: Year CustomerID ProductID Month_1 Qty_1 Month_12 Qty_12
On the cross table page check Source file is a Cross table check box and set First Field to 4, Blocks to 12 and Block length to 2
Version 3 Issue 2
DB Software Laboratory
32 of 59
Finally we are ready to import data Click to load data into the database
Version 3 Issue 2
DB Software Laboratory
33 of 59
Performing Calculations Data Exchange Wizard is capable of performing calculations during import. To perform a simple calculation set mapping type to calculation and type constant or formula into calculation edit box
For character type fields type '12' or "12'' Multiplying fields [INTEGER_F]*[FLOAT_F] Concatenation "[INTEGER_F]"+ " kilos" More complicated examples Iif([FLOAT_F]>[INTEGER_F],1,2) Trim('[CHAR_F]') You may also use an Expression Editor.
Version 3 Issue 2
DB Software Laboratory
34 of 59
Filtering Data User may filter records using the following example: F1=1 Customer information F1=2 Invoices
Filter
Version 3 Issue 2
DB Software Laboratory
35 of 59
If you want to use multiple criteria use following example ([F1]==1) || ([F1]==56) Where || - OR && - AND ! - NOT
Version 3 Issue 2
DB Software Laboratory
36 of 59
Updating/Deleting Records In order to Update or Delete records you must specify update key.
For the example provided below, Data Exchange Wizard will execute the following SQL (Update key is CustomerId, OrderNo) Add New and Update Old Records Select count(*) from [DEMO].[dbo].[orders] where CustomerId=? And OrderNo=? If any records found Data Exchange Wizard will update them by executing Update [DEMO].[dbo].[orders] set orderdate=?, amount=? where customerid=? And OrderNo=? If no records found Data Exchange Wizard will add new records
Version 3 Issue 2
DB Software Laboratory
37 of 59
Data Exchange Wizard User Manual Updating Records Update [DEMO].[dbo].[orders] set OrderDate=?, Amount=? where CustomerId=? And OrderNo=? Deleting Records Delete from [DEMO].[dbo].[orders] Where CustomerId=? And OrderNo=?
Update key Note: Add New and Update Old Records is not supported for SQL Server Connection use ODBC connection instead.
Version 3 Issue 2
DB Software Laboratory
38 of 59
Check constraints Ensure that any constraints on the destination table are checked during the bulk copy operation. By default, constraints are ignored. Keep identity Specify that there are values in the data file for an identity column. Keep NULLS Specify that any columns containing a null value should be retained as null values, even if a default value was specified for that column in the destination table. Batch size Specify the number of rows in a batch. The default is the entire data file. The following values for the Batch size property have these effects: If you set Batch size to zero, the data is loaded in a single batch. The first row that fails will cause the entire load to be cancelled, and the step fails. If you set Batch size to one, the data is loaded a row at a time. Each row that fails is counted as one row failure. Previously loaded rows are committed. If you set Batch size to a value greater than one, the data is loaded one batch at a time. Any row that fails in a batch fails that entire batch; loading stops and the step fails. Rows in previously loaded batches are either committed or, if the step has joined the package transaction, provisionally retained in the transaction, subject to later commitment or rollback. Oracle parameters
The box above allows you to specify Conventional and Direct path loading
Version 3 Issue 2 DB Software Laboratory
39 of 59
7. Exporting Data
Once Data Exchange Wizard is started on Operation Type Page select operation type > Export data. Press the Next button to proceed to the next page
Select Text Qualifier and Delimiter. Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
40 of 59
Data Exchange Wizard User Manual Source Connecion On this step you should enter all necessary settings to connect to the source database First select Database Type, than fill in Server name for MS Sql Server Connection TNS Name for Oracle Connection DNS Name for ODBC Connection Fill in User Name and Password Fill in Database name for MS Sql Server Connection Test connection to make sure it is working Fill in Sql Statements Separator and Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
41 of 59
Data Exchange Wizard User Manual Specify whether your Source is table or Select Statement Press the Next button to proceed to the next page
Depending on your choice you will see one of the following pages Source is Table(s) Select table(s) you want lo load data from or alternatively specify a mask to find tables Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
42 of 59
Data Exchange Wizard User Manual SQL Statements Data Exchange Wizard provides functionality to perform SQL statements before and after data export. Note: In order to Execute several SQL statements user must specify SQL delimiter No select statements allowed Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
43 of 59
Data Exchange Wizard User Manual Fill in Directory Name you want to export data into Every table will be saved into separate file Press the Next button to proceed to the next page
Source is a Select Statement Fill in a select Statement you want to load data from Or alternatively use Query builder to generate Sql Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
44 of 59
Query Builder
Version 3 Issue 2
DB Software Laboratory
45 of 59
Data Exchange Wizard User Manual Fill in File Name you want to export data into Press the Next button to proceed to the next page
Logging Options Check default options and Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
46 of 59
Ready We are now ready to export data from the database Check the information presented and Press the Next button to start exporting data
Processing Data At this step data is being exported from the database You may stop export any time by clicking Stop Press the Next button to proceed to the next page
Version 3 Issue 2
DB Software Laboratory
47 of 59
Data Exchange Wizard User Manual Log Once data is exported it vital to check the log file for any errors Press the Next button to proceed to the next page.
Save Configuration Now when export is completed end user can choose to save the configuration Click finish to close Data exchange wizard.
Version 3 Issue 2
DB Software Laboratory
48 of 59
8. Import Functions
String Functions
Trim
Trim(String):string Trims leading and trailing spaces from a string.
TrimLeft
TrimLeft(String):string Trims leading spaces from a string.
TrimRight
TrimRight(String):string Trims trailing spaces from a string.
UpperCase
UpperCase(String):string UpperCase returns a string with the same text as the string passed in, but with all letters converted to Uppercase
LowerCase
LowerCase(String):string LowerCase returns a string with the same text as the string passed in, but with all letters converted to LowerCase
Replace
Replace(String,OldPattern,NewPattern):string Replace replaces all occurrences of the OldPattern by NewPattern within the String
SubString
SubString(String,Index,Count):string SubString returns a substring containing Count characters or elements starting from Index.
RightString
RightString(String,Count):string RightString returns the trailing characters of String up to a length of Count characters
LeftString
LeftString(String,Count):string
Version 3 Issue 2 DB Software Laboratory
49 of 59
AddCharLeft
AddCharLeft(Char,String,Count):string AddCharLeft returns a string left-padded to Length with characters Char
AddCharRight
AddCharRight(Char,String,Count):string AddCharRight returns a string right-padded to Length with characters Char
MakeString
MakeString(Char,Count):string MakeString returns a string of Count filled with character Char.
DelSpaces
DelSpaces(String):string DelSpaces returns string with all spaces deleted except one. "two spaces"->"two spaces
Delete
Delete(String,Index,Count):String DelSpaces returns string with count characters deleted starting from index.
Insert
Insert(Source,S,Index):String Insert returns string with s string inserted in index.
ProperCase
ProperCase(String):string ProperCase returns string, with the first letter of each word in uppercase and all other letters in lowercase "proper case"->"Proper Case"
Version 3 Issue 2
DB Software Laboratory
50 of 59
Numeric Functions
Abs
Abs(Integer):Integer Abs returns the absolute value of the argument
Round
Round(Float,Integer):Float Use Round to round Value to a specified power of ten. The following examples illustrate the use of Round: Expression Value 1234000 1.23 1.24 1.24
Sign
Sign(Integer): Integer Use Sign to test the sign of a numeric value. Sign returns 0 if AValue is zero. 1 if AValue is greater than zero. -1 if AValue is less than zero.
Version 3 Issue 2
DB Software Laboratory
51 of 59
Date Functions
Day
Day(Date,Format):Integer. Use Day to get the day part of a date value. Day('01012003','DDMMYYYY')
Hour
Hour(Date,Format):Integer. Use Hour to get the hour part of a date value. Hour('01012003','DDMMYYYY')
Minute
Minute(Date,Format):Integer. Use Minute to get the minute part of a date value. Minute('01012003','DDMMYYYY')
Month
Month(Date,Format):Integer. Use Month to get the month part of a date value. Month('01012003','DDMMYYYY')
Second
Second(Date,Format):Integer. Use Second to get the second part of a date value. Second('01012003','DDMMYYYY')
Year
Year(Date,Format):Integer. Use Year to get the year part of a date value. Year('01012003','DDMMYYYY')
Version 3 Issue 2
DB Software Laboratory
52 of 59
Conversion Functions
IntegerToString
IntegerToString(Integer): String. IntegerToString converts integer value to string value.
NumberToString
NumberToString(Float): String NumberToString converts float value to string value.
StringToInteger
StringToInteger(String): Integer StringToInteger converts string value to integer value.
StringToNumber
StringToNumber(String): Float StringToNumber converts string value to float value.
Version 3 Issue 2
DB Software Laboratory
53 of 59
Miscellaneous Functions
Iif
Iif(expr1==expr2,expr3,expr4) Iif function returns expr3 or expr4 depending on expr1==expr2
GetSystemVariable
GetSystemVariable('VARIABLENAME'):string GetSystemVariable returns value of 'VARIABLENAME'. Possible values for 'VARIABLENAME' are: COMPUTERNAME, OSUSERNAME, DBUSERNAME, BLOCKNUMBER, LINENUMBER, RECORDNUMBER, SYSTEM_DATE
Pos
Pos(Substr,String): Integer Pos searches for Substr within String and returns an integer value that is the index of the first character of Substr within String. Pos is case-sensitive. If Substr is not found, Pos returns zero.
GetFileHeaderLine
GetFileHeaderLine(LineNumber): String GetFileHeaderLine function returns header line LineNumber from the source text file
Version 3 Issue 2
DB Software Laboratory
54 of 59
9. Date formats
Date/Time format strings control the conversion of strings into date time type. Date/Time format strings are composed from specifiers which describe values to be converted into the date time value. In the following table, specifiers are given in lower cases. Case is ignored in formats, except for the "am/pm" and "a/p" specifiers. Specifier d dd m mm mmm mmmm yy yyyy h hh n nn s ss tt Description Day as a number without a leading zero (1-31). Day as a number with a leading zero (01-31). Month as a number without a leading zero (1-12). Month as a number with a leading zero (01-12). Month as an abbreviation (Jan-Dec). Month as a full name (January-December). Year as a two-digit number (00-99). Year as a four-digit number (0000-9999). Hour without a leading zero (0-23). Hour with a leading zero (00-23). Minute without a leading zero (0-59). Minute with a leading zero (00-59). Second without a leading zero (0-59). Second with a leading zero (00-59). Uses the 12-hour clock for the preceding h or hh specifier, 'am' for any hour before noon, and 'pm' for any hour after noon.
Version 3 Issue 2
DB Software Laboratory
55 of 59
Version 3 Issue 2
DB Software Laboratory
56 of 59
1. Version number 2. Example of data you are trying to load 3. Script to create a table 4. Database version 5. Operation system version 6. Description of a problem
Version 3 Issue 2
DB Software Laboratory
57 of 59
58 of 59
SEVERABILITY In the event of invalidity of any provision of this license, the parties agree that such invalidity shall not affect the validity of the remaining portions of this license. COPYRIGHT The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. All title and copyrights related to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by DB Software Laboratory. MISCELLANEOUS Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact DB Software Laboratory (see contact information at the top of this EULA). LIMITED WARRANTY DB Software Laboratory expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you. In no event shall DB Software Laboratory be liable for any damages whatsoever or refund of any money (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if DB Software Laboratory has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you. ENTIRE AGREEMENT This is the entire agreement between you and DB Software Laboratory which supersedes any prior agreement or understanding, whether written or oral, relating to the subject matter of this license. Thank you for using the Data Exchange Wizard. DB Software Laboratory
Version 3 Issue 2
DB Software Laboratory
59 of 59