forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › Add Extra Fields While Importing Data?
- This topic is empty.
-
AuthorPosts
-
-
April 5, 2006 at 4:07 pm #9596TGKnIghtMember
When I add extra column into the “Create Table SQL Statement” in the “Migration Toolkit” why don't the extra columns appear in “Column Mapping and Transformations” ?
My problem is… I have a table already created..
Example :
Code:CREATE TABLE `location` (
`ID` int(10) NOT NULL auto_increment,
`ProgramID` int(10) NOT NULL default '0',
`ExternalID` varchar(100) NOT NULL default '',
`ExternalGroup` varchar(50) default NULL,
`Description` varchar(100) default NULL,
`Amount` decimal(19,4) NOT NULL default '0.0000',
`DateUpdated` datetime default '0000-00-00 00:00:00',
`DateAdded` datetime NOT NULL default '0000-00-00 00:00:00',
`Active` tinyint(1) unsigned NOT NULL default '0'
)I am trying to import a customer's data… which only has 3 of the fields in this table… 'ExternalID', 'ExternalGroup' and 'Description'..
I would like to fill the rest of the row with static information… And I would like ID to increment automatically by itself…
What is the best way to do this?
Thank you,
Owen
-
April 5, 2006 at 4:49 pm #21168peterlaursenParticipant
the best way would be .. I think …
1) Run the Migration
2) ALTER TABLE
if you want it fully automated you can create a batch file that 1)first executes a SJA-importjob 2)next executes a SJA-notify job doing the ALTER TABLE.
just like
*******************
sja myimportjob.xml
sja mynotifyjob.xml
*******************
-
April 5, 2006 at 6:27 pm #21169TGKnIghtMember
Ahh nice, the batch file suggestion is what I need…
I'll try to import the client data as is to a temp table, then run a second job which will populate the production table correctly.
Thanks alot!
-
-
AuthorPosts
- You must be logged in to reply to this topic.