Sqlways Documentation
Total Page:16
File Type:pdf, Size:1020Kb
SQLWays Documentation Database and Application Migration Software Version 6.0 Ispirer Systems Ltd. Copyright © 1999-2015 Ispirer Systems Ltd. Ispirer and SQLWays are trademarks of Ispirer Systems Ltd. All other product names may be trademarks of the respective companies. All rights reserved. www.ispirer.com Contents Contents Conventions Used in This Manual Introduction Key Benefits ...................................................................... 13 Supported Databases......................................................... 14 Database Object and Features Support.............................. 16 IBM DB2 for Linux, Unix and Windows Support ............................. 17 IBM DB2 for z/OS and OS/390 Support ....................................... 19 IBM DB2 for iSeries and AS/400 Support ..................................... 21 Oracle Support ......................................................................... 23 Microsoft SQL Server Support .................................................... 25 MySQL Support ........................................................................ 27 PostgreSQL Support .................................................................. 29 Sybase Adaptive Server Enterprise Support .................................. 31 Pervasive.SQL Support .............................................................. 32 What’s New....................................................................... 33 Getting Started Preparing for Installation .................................................. 35 Installing SQLWays ........................................................... 36 Putting SQLWays in Operation ........................................... 37 Database Migration Concepts Migration Process in SQLWays........................................... 39 Stages of Migration Process ....................................................... 40 Stage 1. Exporting and Converting ......................................... 41 Files Created for Importing to IBM DB2 .............................. 42 Files Created for Importing to Oracle .................................. 43 Files Created for Importing to Microsoft SQL Server ............. 44 Files Created for Importing to MySQL ................................. 45 Stage 2. Transferring and Processing (optional) ....................... 46 Stage 3. Importing ............................................................... 47 Comparative Analysis of Databases ................................... 48 Identifiers ............................................................................... 49 Maximum Length of Identifiers............................................... 50 2 Contents Allowed Characters in Identifiers ............................................ 51 Delimited Identifiers ............................................................. 52 Expressions and Statements ...................................................... 54 Variable Declaration ............................................................. 55 Conversion of Variable Declarations from Microsoft SQL Server to MySQL 58 Conversion of the Informix variable declarations to Oracle .... 59 Conversion of Oracle %ROWTYPE to MySQL ........................60 Conversion of Oracle %TYPE to Microsoft SQL Server ........... 62 Declaration of Local Variables with Composite Data Types ..... 63 Conversion of Oracle RECORD Variable to Microsoft SQL Server 64 Assignment Statements ........................................................ 65 Conversion of Assignment Statement from Microsoft SQL Server to Oracle .............................................................................................. 66 Conditional Expressions ........................................................ 67 Conversion of Oracle DECODE to MySQL CASE .................... 71 SELECT Statement ............................................................... 72 Restricting Number of Rows in Result Set ........................... 73 Conversion of Microsoft SQL Server TOP clause to Oracle ...............74 Executing Procedures and User-Defined Functions .................... 76 Conversion of Execution Procedures and User-Defined Functions from Microsoft SQL Server to Oracle ............................................................ 79 Conversion of Sybase Adaptive Server Anyware CALL to Microsoft SQL Server ............................................................................................. 80 Executing Dynamic SQL Statements with Parameters ................ 81 Conversion of Dynamic Statement Execution from Microsoft SQL Server to Oracle .......................................................................................... 84 Cursors............................................................................... 85 Cursor Declaration ........................................................... 86 Cursor Declaration Conversion from Microsoft SQL Server to Oracle 87 Conversion of Cursor with Parameters from Oracle to MySQL . 88 Transaction Control .............................................................. 89 Starting Transaction ........................................................ 90 BEGIN TRANSACTION Conversion from Microsoft SQL Server to Oracle 91 COMMIT Statement .......................................................... 92 COMMIT conversion from Microsoft SQL Server to Oracle ...... 93 Functions ................................................................................ 94 Number Functions ................................................................ 95 Converting String to Number ............................................ 96 String Functions................................................................. 100 Concatenating Strings .................................................... 101 Converting Expression to String ....................................... 103 Converting ASCII Code to Character ................................ 107 Converting Datetime Expression with Format String to String 109 Conversion of Oracle TO_CHAR(datetime) with format string to MySQL 115 Returning Substring from String ...................................... 118 Conversion of Microsoft SQL Server Functions Returning Part of String to 3 SQLWays Documentation Copyright © 1999-2015 Contents Oracle ...........................................................................................................................120 Returning String in Uppercase ......................................... 121 Returning Position of Substring in String ..........................................122 Conversions of Microsoft SQL Server CHARINDEX to Oracle . 127 Removing (or Trimming) Characters from a String ............. 128 Conversion of Sybase Adaptive Server Anyware TRIM to Microsoft SQL Server 129 Returning Information about Database and Current Connection 130 Returning Information about Current User ........................ 131 Replace NULL value functions .............................................. 132 Returning the first non-NULL expression ........................... 133 Returning one of expressions depending on whether check expression is NULL or NOT NULL ........................................................................... 136 Conversion of Sybase ASA IFNULL to Microsoft SQL Server .......137 Techniques ............................................................................ 138 Returning Non-Table Data as Result Set (Dummy Tables) ........ 139 Non-Table Result Set Conversion from Sybase Adaptive Server Anywhere to Microsoft SQL Server ..................................................... 140 Returning Result Sets from Procedure ................................... 141 Returning Result Set to Client ......................................... 142 Result Set Conversion from Microsoft SQL Server to IBM DB2 143 Migrating to IBM DB2 .........................................................144 IBM DB2 Data Types ............................................................... 145 CHAR, VARCHAR and LONG VARCHAR................................... 146 GRAPHIC, VARGRAPHIC and LONG VARGRAPHIC .................... 147 BIGINT, INTEGER and SMALLINT.......................................... 148 DECIMAL or NUMERIC......................................................... 149 FLOAT, REAL and DOUBLE ................................................... 150 DATE, TIME and TIMESTAMP ............................................... 151 BLOB, CLOB and DBCLOB.................................................... 152 DATALINK ......................................................................... 153 IBM DB2 Functions and Expressions .......................................... 154 IBM DB2 Expressions.......................................................... 155 Simple CASE Expression ................................................. 156 IBM DB2 Functions ............................................................. 157 COALESCE .................................................................... 158 LEFT ............................................................................ 159 LENGTH ....................................................................... 160 RIGHT .......................................................................... 161 IBM DB2 Special Registers................................................... 162 CURRENT TIMESTAMP .................................................... 163 IBM DB2 LOAD Command ........................................................ 164 LOAD Command Options ....................................................