If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Master Data Management

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-08, 13:03
HPS_Man HPS_Man is offline
Registered User
 
Join Date: Nov 2008
Posts: 5
Lightbulb Master Data Management

I am attempting to insert all objects (users, tables, fields, indexes, ...) from DDL scripts generated from ERDs across multiple RDBMS vendors into an MDM database created in MySQL. Are they any quick ways or utilities to generate these DML INSERT statements containing these SQL objects without the need to create a parsing application?

Cheers, JP
Reply With Quote
  #2 (permalink)  
Old 11-19-08, 13:18
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
have you tried MySQL Workbench?

http://dev.mysql.com/downloads/workbench/5.0.html

cheers
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-19-08, 13:43
HPS_Man HPS_Man is offline
Registered User
 
Join Date: Nov 2008
Posts: 5
I did and it does not generate the INSERT statement automatically: it only creates INSERTS without the actual values...
Reply With Quote
  #4 (permalink)  
Old 11-19-08, 14:05
HPS_Man HPS_Man is offline
Registered User
 
Join Date: Nov 2008
Posts: 5
Converting DDL script into DML inserts for all DDL objects

From a DDL script like:

create table `test`.`customer`(
`cust_id` INT not null auto_increment comment 'Customer identifier',
`organization` VARCHAR(100) not null comment 'Name of organization',
`address1` VARCHAR(50) comment 'First part of the customer address',
`address2` VARCHAR(50) comment 'Second part of the customer address',
`city` VARCHAR(50) not null comment 'City where customer is located',
`state` CHAR(2) not null comment 'State where the customer is located',
`zipcode` CHAR(5) not null comment 'Customer 5-digit zip code',
primary key (`cust_id`)
);

I would like to insert the TABLE customer and its associated FIELDS in the following tables:

Insert table values:

INSERT INTO `tables` (`tbl_id`, `tbl_nm`, `schem_id`, `last_change`)
VALUES (null ,`test`.`customer`, 1, null);

It returns tbl_id=1

Then insert values for all fields

... for the first field 'cust_id' we have:

INSERT INTO `fields` (`field_id`, `field_nm`, `tbl_id`, `field_type`, `field_size`,
`field_decimal`, `field_definition`, `last_change`)
VALUES (null ,cust_id`, 1, INT, null, null, 'Customer identifier',null);

... for the second field 'organization' we have:

INSERT INTO `fields` (`field_id`, `field_nm`, `tbl_id`, `field_type`, `field_size`,
`field_decimal`, `field_definition`, `last_change`)
VALUES (null ,organization`, 1, VARCHAR, 100, 0, 'Name of organization that the customer is part of',null);


... and so on for all the fields.

I know DB studio has a similar feature, but it is done manually for all objects. We need to automateicaly propagate any changes to the real databases into the MDM repository.

Any ideas!
Reply With Quote
  #5 (permalink)  
Old 11-19-08, 15:35
HPS_Man HPS_Man is offline
Registered User
 
Join Date: Nov 2008
Posts: 5
Gully!

I found a way using DbUtils:

1. Convert DDL to XML
2. Parse XML tags into DML insert scripts
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On