Feature - detailed INSERT

General usage of Access to MySQL

Moderator: jr

Post Reply
serg
Posts: 4
Joined: Thu May 18, 2006 7:48 am

Feature - detailed INSERT

Post by serg »

Again, thank you for a great job. This is the best converter from Access to MySQL - I tried several..

The feature which could be extremely useful - detailed INSERT in the dump file. By detailed I mean generation of INSERT statements like "INSERT INTO table SET field1='value1', field2='value2' ...". This is extremely useful when importing into SQL database big amounts of data from Access/Excel tables with incomplete field set (usually while data migration of merging databases) or converting databases.

Apoligies, if I am mistaking, and this feature already implemented, but I did not found it in the latest release.
jr
Site Admin
Posts: 500
Joined: Sun Mar 26, 2006 12:28 pm

Post by jr »

Hi serg,

This feature is not in the program. I'm not sure that I understand you completely. Would you like the program to set different fields for each record depending on the data in the source table (i.e. not set NULL values). Or would you like it to set all fields using this syntax.

Jacob
serg
Posts: 4
Joined: Thu May 18, 2006 7:48 am

Post by serg »

Hi Jacob,

I meant setting all the fields from MS Access table (or those I have choosen in the fields list). Right now it generates insert statements like "INSERT INTO table VALUES (value1, value2...)". But I propose to generate like "INSERT INTO table SET field1='value1', field2='value2' ...".

This will execute the insert without SQL error even when number of fields in source and destnation databases are not the same.

For example:

I have Mysql database of contacts, which consist of 20 fields, including address, phones, ICQ, email and other fields. And I have a list of my friends from my Outlook, which has only name and email. I can export my email address book into MS Access and then try to import into MySQL. If I use "INSERT INTO table VALUES (value1, value2...)", than fields in the MS Access table and MySQL table should be the same, but it is not! So this will generate an error.

On the other hand, if I use "INSERT INTO table SET field1='value1', field2='value2' ..." which will include only name and email - it will import into MySQL all my email address book, leaving other fields empty.
vitalijkopz
Posts: 1
Joined: Tue Dec 12, 2006 6:58 pm

Post by vitalijkopz »

[quote="serg"]Again, thank you for a great job. This is the best converter from Access to MySQL - I tried several....[/quote]That means is not present?

_________________

Effective intellectual advertising at forums. Analogues are not present. e-mail: info@advv.ru, ICQ: 352734559
taquitosensei
Posts: 2
Joined: Fri Jul 11, 2008 9:01 pm

Post by taquitosensei »

I think he means more like this
insert into table(field1,field2,field3,field4,etc) values('value1','value2','value3','value4','etc')
Post Reply