US 7,430,558 B2
Transfer of table instances between databases
Matthew J. Bangel, Poughkeepsie, N.Y. (US); and James A. Martin, Jr., Endicott, N.Y. (US)
Assigned to International Business Machines Corporation, Armonk, N.Y. (US)
Filed on Jan. 31, 2005, as Appl. No. 11/47,191.
Prior Publication US 2006/0173809 A1, Aug. 03, 2006
Int. Cl. G06F 11/00 (2006.01)
U.S. Cl. 707—101  [707/200; 707/201] 4 Claims
OG exemplary drawing
 
1. A method for transferring table instances X1, X2, . . . , XN of a table T from a source database S to N destination databases D1, D2, . . . , DN, respectively, said method being implemented by executing a computer code by a processor of a computer system, said N being at least 1, said method comprising for I=1, 2, . . . , N:
determining whether the table T has been defined for destination database DI, and if said determining determines that the table T has not been defined for the destination database DI then defining the table T for the destination database DI; and
transferring the instance XI of the N table instances from the source database S into the defined table T of the destination database DI,
wherein the method further comprises prior to said determining whether the table T has been defined for destination database DI and prior to said transferring the instance XI;
specifying an instance configuration pertaining to the table instance XI , wherein the instance configuration consists of an instance variable of the table T in combination with a value of the instance variable, and wherein the instance variable defines a set of rows of the table T pertaining to the table instance XI;
generating a first database query statement from said instance configuration pertaining to the table instance XI, wherein the first database query statement is configured to return the table instance XI from the table T in the source database S in response to being performed; and
performing a first source database query on the source database S using the generated first database query statement, resulting in returning the table instance XI from the table T in the source database,
wherein said determining whether the table T has been defined for destination database DI comprises:
generating a destination database query statement from said instance configuration pertaining to the table instance XI, wherein the destination database query statement is configured to return data from the table T in the destination database DI in response to being performed; and
performing a destination database query on the destination database DI using the generated second database query statement, resulting in returning data from the table T in the destination database DI if the table T has been defined for destination database DI or in not returning data from the table T in the destination database DI if the table T has not been defined for destination database DI,
wherein said performing the destination database query on the destination database DI results in not returning data from the table T in the destination database DI, wherein said defining the table T for the destination database DI comprises:
creating schema and determining metadata associated with the schema, wherein said schema and associated metadata define the table T in the destination database DI,
wherein said determining metadata comprises performing a second database query on the source database S, resulting in returning the metadata from the source database S.