Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy without overridding existing columns

Status
Not open for further replies.

granni

Programmer
Nov 8, 2000
36
SG
Does anyone noe how to programmatically create columns? I'm trying to copy fields from 1 table to another, @ the same time creating some new columns in the target table.

Thanks :) In Christ Jesus
 
Here are two ways to do this:

1) Use COPY STRUCTURE EXTENDED to create a new table that contains the original structure, using one record to describe each field in the original. You can then append this table with the data for the new fields. Then use this table to create a new table with the original structure plus the added fields with the CREATE ... FROM command.

2) Programmatically create a new table using the SQL 'CREATE TABLE' command. You will need to plug that command into an executeSQL() method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top