Imports Objects from Relational Databases. More...
Public Member Functions | |
_.Library.Status | Connect (_.Library.String dsn, _.Library.String localuser, _.Library.Boolean isJDBC) |
Connect to the client system via an SQL Gateway Connection (ODBC or JDBC), and initializes some structures More... | |
_.Library.Status | CopyData (_.Library.String TbOwner, _.Library.String TbName, _.Library.String ScrubRoutine) |
CopyData (for ODBC connection) - Copies the data from the source system to this system More... | |
_.Library.Status | CopyDataJ (_.Library.String TbOwner, _.Library.String TbName, _.Library.String ScrubRoutine) |
CopyDataJ (for JDBC connection) - Copies the data from the source system to this system More... | |
_.Library.Status | CopyTableFKeys (_.Library.String FkTbOwner, _.Library.String FkTbName) |
Copy Foreign Keys from remote DB via ODBC to InterSystems IRIS for the given FK Table. More... | |
_.Library.Status | CopyTableFKeysJ (_.Library.String FkTbOwner, _.Library.String FkTbName, _.Library.Boolean verbose) |
Copy Foreign Keys from remote DB via JDBC to InterSystems IRIS for the given FK Table. More... | |
_.Library.Status | CopyTableStruct (_.Library.String TbOwner, _.Library.String TbName, _.Library.Boolean verbose) |
Cleanup previous version of table (Table,Index,Foreign Keys), re-create. More... | |
_.Library.Status | CopyView (_.Library.String VOwner, _.Library.String VName) |
Copy One View and its dependencies via ODBC. More... | |
_.Library.Status | CopyViewJ (_.Library.String VOwner, _.Library.String VName) |
Copy One View and its dependencies via JDBC. More... | |
CopyViewRecursive (_.Library.String VOwner, _.Library.String VName, _.Library.String hstmt) | |
Find dependencies. More... | |
CopyViewRecursiveJ (_.Library.String VOwner, _.Library.String VName) | |
Find dependencies. More... | |
_.Library.Status | Disconnect () |
Disconnect from the SQL Gateway (ODBC) | |
_.Library.Integer | ErrorCount () |
Returns the current number of import errors. | |
_.Library.String | Gethdbc () |
Returns Database handle for current connection ("" or 0 if not connected) | |
![]() | |
_.Library.Status | OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount) |
This callback method is invoked when the current object is added to the SaveSet,. More... | |
_.Library.Status | OnClose () |
This callback method is invoked by the <METHOD>Close</METHOD> method to. More... | |
_.Library.Status | OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned) |
This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More... | |
_.Library.Status | OnNew () |
This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
_.Library.Status | OnValidateObject () |
This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More... | |
![]() | |
AddOwnerMap (_.Library.String SourceOwner, _.Library.String DestOwner) | |
Add 1 Mapping of Source schema to destination schema. | |
ClearOwnerMap () | |
Deletes all the content of the OwnerMap. | |
CopyOneView (_.Library.String VOwner, _.Library.String VName, _.Library.String hstmt) | |
Copy one view Definition from the remote DB to InterSystems IRIS. | |
CopyOneViewJ (_.Library.String VOwner, _.Library.String VName) | |
Copy one view Definition from the remote DB to InterSystems IRIS. | |
_.Library.String | DatatypeName (_.Library.String DType, _.Library.Integer Precision, _.Library.Integer Length, _.Library.Integer Scale, _.Library.String DtName, _, _.Library.String msg) |
Returns Name of InterSystems IRIS Datatype for given column | |
_.Library.Status | DropForeignKeys (_.Library.String TbOwner, _.Library.String TbName, _.Library.Boolean verbose) |
Given a table, drop any foreign keys constraint defined on that table. | |
_.Library.Status | DropTable (_.Library.String TbOwner, _.Library.String TbName, _.Library.Boolean verbose) |
Drops one table on destination. More... | |
_.Library.Status | DropView (_.Library.String VOwner, _.Library.String VName, _.Library.Boolean verbose) |
Drops one View on destination. | |
_.Library.Status | ExecSql (_.Library.String stsql) |
Executes an Sql Statement in the current namespace as localUser. | |
_.Library.String | FindIdentity (_.Library.String TbOwner, _.Library.String TbName, _.Library.String hstmt) |
Returns a $list of Columns Names which are AutoIncrement/Identity in source Database. | |
_.Library.String | FindIdentityJ (_.Library.String TbOwner, _.Library.String TbName) |
Returns a $list of Columns Names which are AutoIncrement/Identity in source Database. | |
_.Library.String | FindViewDeps (_.Library.String VOwner, _.Library.String VName, _.Library.String hstmt) |
Get List of Dependencies for a View. | |
_.Library.String | IFXFindNotNull (_.Library.String TbOwner, _.Library.String TbName, _.Library.String hstmt) |
Informix:Returns a $list of Column Names which are Not NULL is source DB. | |
_.Library.String | OraDefault (_.Library.String TbOwner, _.Library.String TbName, _.Library.String ColName) |
Oracle: returns Column Default from ALL_TAB_COLUMNS. | |
_.Library.Integer | isaView (_.Library.String TbOwner, _.Library.String TbName, _.Library.String hstmt) |
Finds out if the given Table is a Table (0) or a View (1) | |
_.Library.Integer | isaViewJ (_.Library.String TbOwner, _.Library.String TbName) |
Finds out if the given Table is a Table (0) or a View (1) | |
Private Member Functions | |
_.Library.Status | __CpTableIndex (_.Library.String TbOwner, _.Library.String TbName) |
Copied Indices from remote DB via ODBC to InterSystems IRIS for the specified table. More... | |
_.Library.Status | __CpTableIndexJ (_.Library.String TbOwner, _.Library.String TbName, _.Library.String pkColumns, _.Library.Boolean verbose) |
Copied Indices from remote DB via JDBC to InterSystems IRIS for the specified table. More... | |
_.Library.Status | __CpTableSchema (_.Library.String TbOwner, _.Library.String TbName) |
Copy the table definition via ODBC to InterSystems IRIS: Fields, Datatypes, Not Null Columns, Defaults columns, and table Primary Key. More... | |
_.Library.Status | __CpTableSchemaJ (_.Library.String TbOwner, _.Library.String TbName, _.Library.String pkColumns) |
Copy the table definition via JDBC to InterSystems IRIS: Fields, Datatypes, Not Null Columns, Defaults columns, and table Primary Key. More... | |
_.Library.Status | __Datatypes () |
Build Array of Datatypes for source Database. | |
Additional Inherited Members | |
![]() | |
ClearErrors () | |
Clears the Migration Error Log for this instance. | |
ClearStatusMsg () | |
Clear the Migration status message list. | |
_.Library.String | GetCGateHandle () |
Initializes before using the SqlGateWay Calls. More... | |
_.Library.String | GetLastErrorMsg () |
Returns last Error of Migration process. | |
_.Library.String | GetLastStatusMsg () |
Returns current Status of Migration process. | |
LogError (_.Library.String FuncName, _.Library.Integer errno, _.Library.String errdesc, _.Library.String TbOwner, _.Library.String TbName, _.Library.String sql) | |
Logs an Error into the Migration Error Log. | |
LogStatusMsg (_.Library.String msg) | |
Logs Status message. | |
ShowAllErrors () | |
Displays all Errors for current Migration process on current device. | |
![]() | |
Debug | |
Debugging ? More... | |
DebugOutFile | |
OutputFile for Sql Statements executed (to Debug) More... | |
DeferIndices | |
If true, generate indices after importing data. More... | |
DeleteExistingData | |
Delete Exiting Data from table before importing. More... | |
GTWUnicode | |
Does the Gateway support Wide Calls? More... | |
MaxErrors | |
maximum number of Data Import Errors to report per table when Copying Data 0=All More... | |
NoCheck | |
If true, import will insert with NOCHECK. More... | |
NoJournal | |
If true, import will run without journaling enabled. More... | |
NoTrigger | |
If true, import will insert with NOTRIGGER. More... | |
PreservePKName | |
Preserve Primary Key Constraint Name when importing table. More... | |
![]() | |
CAPTION = None | |
Optional name used by the Form Wizard for a class when generating forms. More... | |
JAVATYPE = None | |
The Java type to be used when exported. | |
PROPERTYVALIDATION = None | |
This parameter controls the default validation behavior for the object. More... | |
![]() | |
RTNPREFIX = None | |
Utilities for Sql Migration. More... | |
Imports Objects from Relational Databases.
_.Library.Status Connect | ( | _.Library.String | dsn, |
_.Library.String | localuser, | ||
_.Library.Boolean | isJDBC | ||
) |
Connect to the client system via an SQL Gateway Connection (ODBC or JDBC), and initializes some structures
Arguments:
dsn - is the name of the SQL Gateway Connection to connect to
localuser - obsolete
isJDBC - 1/0 flag. If this SQL Gateway connection is via JDBC use 1, otherwise use 0. 0 (ODBC) is the default parameter value
_.Library.Status CopyData | ( | _.Library.String | TbOwner, |
_.Library.String | TbName, | ||
_.Library.String | ScrubRoutine | ||
) |
CopyData (for ODBC connection) - Copies the data from the source system to this system
1 - get list of fields on source table (through gateway)
2 - construct select list for source
3 - construct update list for dest
4 - select loop on source
* for each, insert into destination
* for each Blob on source:
* while whole blob not fetched
* fetch blob block from source
* add blob to destination blob
5 - create indices, ....or anything
Arguments:
TbOwner - Name of the owner/schema of the target table
TbName - Name of the target table
ScrubRoutine - Name of a routine to call to scrub/modify the incoming data
DATA SCRUBBING:
For each data import process, a Routine can be speficied to modify field values prior to inserting them into InterSystems IRIS. This also allows to skip specific rows of data, preventing their insertion into InterSystems IRIS. The user-written Data scrubbing routine must provide 2 entry points. Metadata(TbOwner,TbName,colNums,colSqlTypes,colStreamTypes) Data(colData)
Metadata is called once for each table to copy, to pass information about the TableOwner, TableName, ColumnNames and Datatypes. It is a good place to perform the processing that needs to be done once per table.
Arguments:
TbOwner - The SQL Schema in the origin datasource TbName - The SQL Table name colNums- An array 1..N. One element per column in the table. colNum(i)="Column_Name" colSqlTypes - An array 1..N One element per column in the table. The value is the SQL Datatype in the source Database. Values are ODBC Values as defined in SQLMigration.inc: #define SQLCHAR 1 #define SQLBIGINT -5 #define SQLBINARY -2 #define SQLBIT -7 #define SQLDATE 9 #define SQLDECIMAL 3 #define SQLDOUBLE 8 #define SQLFLOAT 6 #define SQLGUID -11 #define SQLINTEGER 4 #define SQLLONGVARCHAR -1 #define SQLLONGVARBINARY -4 #define SQLNUMERIC 2 #define SQLREAL 7 #define SQLSMALLINT 5 #define SQLTINYINT -6 #define SQLTIME 10 #define SQLTIMESTAMP 11 #define SQLVARBINARY -3 #define SQLVARCHAR 12 colStreamTypes - An array 1..N. One element per column in the table. The value is 0: if the column data is not a stream 1: if the column data is contained in a CharacterStream 2: if the column data is contained in a BinaryStream
Return value: none (Quit with no argument)
Data is called once for each row fetched from the origin datasource. This function must return 1 to insert this Row, and 0 if the Row should not be inserted into InterSystems IRIS.
Arguments:
colData() - Is an array 1..N of values. colData(i) is the column Data in ODBC format if the column is not a Stream (a Date is represented in the YYYY-MM-DD Format. An empty String is represented by a $c(0) character, and a NULL value is represented as ""). For BLOB columns, represented in InterSystems IRIS as Streams, it is an ID to an Open CharacterStream or BinaryStream as specified in the colStreamTypes array that was passed to the Metadata function. To change the value of a column 'i', the Data function can simply modify the value in colData(i). To change the value of a Blob column, the Data function can modify the Stream, or modify the Stream reference. It must return in colData(i) a $zobjint() of an oref to a Stream.
_.Library.Status CopyDataJ | ( | _.Library.String | TbOwner, |
_.Library.String | TbName, | ||
_.Library.String | ScrubRoutine | ||
) |
CopyDataJ (for JDBC connection) - Copies the data from the source system to this system
1 - get list of fields on source table (through gateway)
2 - construct select list for source
3 - construct update list for dest
4 - select loop on source
* for each, insert into destination
* for each Blob on source:
* while whole blob not fetched
* fetch blob block from source
* add blob to destination blob
5 - create indices, ....or anything
Arguments:
TbOwner - Name of the owner/schema of the target table
TbName - Name of the target table
ScrubRoutine - Name of a routine to call to scrub/modify the incoming data
DATA SCRUBBING:
For each data import process, a Routine can be speficied to modify field values prior to inserting them into InterSystems IRIS. This also allows to skip specific rows of data, preventing their insertion into InterSystems IRIS. The user-written Data scrubbing routine must provide 2 entry points. Metadata(TbOwner,TbName,colNums,colSqlTypes,colStreamTypes) Data(colData)
Metadata is called once for each table to copy, to pass information about the TableOwner, TableName, ColumnNames and Datatypes. It is a good place to perform the processing that needs to be done once per table.
Arguments:
TbOwner - The SQL Schema in the origin datasource TbName - The SQL Table name colNums- An array 1..N. One element per column in the table. colNum(i)="Column_Name" colSqlTypes - An array 1..N One element per column in the table. The value is the SQL Datatype in the source Database. Values are ODBC Values as defined in SQLMigration.inc: #define SQLCHAR 1 #define SQLBIGINT -5 #define SQLBINARY -2 #define SQLBIT -7 #define SQLDATE 9 #define SQLDECIMAL 3 #define SQLDOUBLE 8 #define SQLFLOAT 6 #define SQLGUID -11 #define SQLINTEGER 4 #define SQLLONGVARCHAR -1 #define SQLLONGVARBINARY -4 #define SQLNUMERIC 2 #define SQLREAL 7 #define SQLSMALLINT 5 #define SQLTINYINT -6 #define SQLTIME 10 #define SQLTIMESTAMP 11 #define SQLVARBINARY -3 #define SQLVARCHAR 12 colStreamTypes - An array 1..N. One element per column in the table. The value is 0: if the column data is not a stream 1: if the column data is contained in a CharacterStream 2: if the column data is contained in a BinaryStream
Return value: none (Quit with no argument)
Data is called once for each row fetched from the origin datasource. This function must return 1 to insert this Row, and 0 if the Row should not be inserted into InterSystems IRIS.
Arguments:
colData() - Is an array 1..N of values. colData(i) is the column Data in ODBC format if the column is not a Stream (a Date is represented in the YYYY-MM-DD Format. An empty String is represented by a $c(0) character, and a NULL value is represented as ""). For BLOB columns, represented in InterSystems IRIS as Streams, it is an ID to an Open CharacterStream or BinaryStream as specified in the colStreamTypes array that was passed to the Metadata function. To change the value of a column 'i', the Data function can simply modify the value in colData(i). To change the value of a Blob column, the Data function can modify the Stream, or modify the Stream reference. It must return in colData(i) a $zobjint() of an oref to a Stream.
_.Library.Status CopyTableFKeys | ( | _.Library.String | FkTbOwner, |
_.Library.String | FkTbName | ||
) |
Copy Foreign Keys from remote DB via ODBC to InterSystems IRIS for the given FK Table.
Arguments:
FkTbOwner - Name of the owner/schema of the foreign key table
FkTbName - Name of the target table to get Foreign Keys from
_.Library.Status CopyTableFKeysJ | ( | _.Library.String | FkTbOwner, |
_.Library.String | FkTbName, | ||
_.Library.Boolean | verbose | ||
) |
Copy Foreign Keys from remote DB via JDBC to InterSystems IRIS for the given FK Table.
Arguments:
FkTbOwner - Name of the owner/schema of the foreign key table
FkTbName - Name of the target table to get Foreign Keys from
_.Library.Status CopyTableStruct | ( | _.Library.String | TbOwner, |
_.Library.String | TbName, | ||
_.Library.Boolean | verbose | ||
) |
Cleanup previous version of table (Table,Index,Foreign Keys), re-create.
table with Fields, Unique and Primary Key constraints, and Index Definitions
Arguments:
TbOwner - Name of the owner/schema of the table
TbName - Name of the target table
verbose - 1/0 flag. If 1 display output to screen. Default os 0.
_.Library.Status CopyView | ( | _.Library.String | VOwner, |
_.Library.String | VName | ||
) |
Copy One View and its dependencies via ODBC.
Arguments:
VOwner - Name of the owner/schema of the view
VName - Name of the target view
_.Library.Status CopyViewJ | ( | _.Library.String | VOwner, |
_.Library.String | VName | ||
) |
Copy One View and its dependencies via JDBC.
Arguments:
VOwner - Name of the owner/schema of the view
VName - Name of the target view
CopyViewRecursive | ( | _.Library.String | VOwner, |
_.Library.String | VName, | ||
_.Library.String | hstmt | ||
) |
Find dependencies.
Copy each dependency View via ODBC
Arguments:
VOwner - Name of the owner/schema of the view
VName - Name of the target view
CopyViewRecursiveJ | ( | _.Library.String | VOwner, |
_.Library.String | VName | ||
) |
Find dependencies.
Copy each dependency View via JDBC
Arguments:
VOwner - Name of the owner/schema of the view
VName - Name of the target view
|
private |
Copied Indices from remote DB via ODBC to InterSystems IRIS for the specified table.
Note: currently, all Indices, be they user or system defined, are copied as normal indices. Oracle Bitmap Indices and Sql Server Clustered Indices are copied as normal Indices. Indices on Primary Keys are not created, as those are automatically generated.
Arguments:
TbOwner - Name of the owner/schema of the table
TbName - Name of the target table
|
private |
Copied Indices from remote DB via JDBC to InterSystems IRIS for the specified table.
Note: currently, all Indices, be they user or system defined, are copied as normal indices. Oracle Bitmap Indices and Sql Server Clustered Indices are copied as normal Indices. Indices on Primary Keys are not created, as those are automatically generated.
Arguments:
TbOwner - Name of the owner/schema of the table
TbName - Name of the target table
pkColumns - Passed by Reference. returns primary key columns verbose - 1/0 flag. If 1 display output to screen. Default os 0.
|
private |
Copy the table definition via ODBC to InterSystems IRIS: Fields, Datatypes, Not Null Columns, Defaults columns, and table Primary Key.
Not copied by this function are: Foreign Key constraints, Check Constraints, table Triggers, Autoincrements.
Arguments:
TbOwner - Name of the owner/schema of the table
TbName - Name of the target table
|
private |
Copy the table definition via JDBC to InterSystems IRIS: Fields, Datatypes, Not Null Columns, Defaults columns, and table Primary Key.
Not copied by this function are: Foreign Key constraints, Check Constraints, table Triggers, Autoincrements.
Arguments:
TbOwner - Name of the owner/schema of the table
TbName - Name of the target table
pkColumns - Passed by Reference. returns primary key columns