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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to migrate to MySQL 1

Status
Not open for further replies.

doorbreaker

Programmer
Nov 19, 2002
91
0
0
GB
Hi,

I am trying to migrate some data from Access to Mysql via ODBC. I have successfully set up all of my datasources but the query to select from Access and insert into MySQL doesn't seem to be working:

INSERT INTO oem ( oemnumber, manufacturer, description )
VALUES (select [STOCK].[PARTNO], [STOCK].[MANU], [STOCK].[DESC] from stock);

When I try and save the query it errors (syntax error in query expresion 'select [stock.partno]')- can anyone help at all??

Many thanks

Chris Moore
 
The query you gave contains two separate syntaxes together. It is either:

Code:
INSERT INTO <table>(<field list>) VALUES (<value list>);

or:

Code:
INSERT INTO <table>[(<field list>)] SELECT <field list> FROM <table>);

The first one is used for &quot;hardcoded&quot; values, the second for values that are looked up from another database or table.

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top