Data Migration in a Database Management System
AssigneeInternational Business Machines Corporation
InventorsKarla Bester, Allan T. Chandler, Mark A. Shewell, Stephen J. Yates
Life of this patent
Estimating the term…
Abstract
An approach is provided to copy records between tables in a relational database. In the approach, a Structured Query Language (SQL) table COPY statement is received with the COPY statement identifying a source table and a target table. Table column names are retrieved from a metadata that corresponds to the source table. The retrieved table column names are used to generate an SQL statement that includes an INSERT INTO clause pertaining to the target table and a SELECT clause pertaining to the source table, wherein the INSERT INTO clause includes a set of target column names and wherein the SELECT clause includes a set of corresponding source column names
Claims20
A method, implemented by an information handling system, that copies records between tables in a relational database, the method comprising:
- receiving a Structured Query Language (SQL) table COPY statement, wherein the COPY statement identifies a source table and a target table;
- retrieving a plurality of column names from a metadata corresponding to the source table;
- and
- generating an SQL statement that includes an INSERT INTO clause pertaining to the target table and a SELECT clause pertaining to the source table, wherein the INSERT INTO clause includes a set of target column names and wherein the SELECT clause includes a set of corresponding source column names.
An information handling system comprising:
- a plurality of processors;
- a memory coupled to at least one of the processors;
- a set of instructions stored in the memory and executed by at least one of the processors to copy records between tables in a relational database, wherein the set of instructions perform actions of:
- receiving a Structured Query Language (SQL) table COPY statement, wherein the COPY statement identifies a source table and a target table;
- retrieving a plurality of column names from a metadata corresponding to the source table;
- and
- generating an SQL statement that includes an INSERT INTO clause pertaining to the target table and a SELECT clause pertaining to the source table, wherein the INSERT INTO clause includes a set of target column names and wherein the SELECT clause includes a set of corresponding source column names.
A computer program product stored in a computer readable medium, comprising computer instructions that, when executed by an information handling system, causes the information handling system to copy records between tables in a relational database by performing actions comprising:
- receiving a Structured Query Language (SQL) table COPY statement, wherein the COPY statement identifies a source table and a target table;
- retrieving a plurality of column names from a metadata corresponding to the source table;
- and
- generating an SQL statement that includes an INSERT INTO clause pertaining to the target table and a SELECT clause pertaining to the source table, wherein the INSERT INTO clause includes a set of target column names and wherein the SELECT clause includes a set of corresponding source column names.
Dependencies are inferred from the claim text.