0

I'm trying to import a table from a database to another but keep getting this error

the command:

INSERT IGNORE INTO epdbraid.spawnpoints ( 
    id, spawn_id, lat, lon, despawn_time, updated 
) 
SELECT 
    0, 
    CAST(CONV(id,16,10) AS INTEGER), 
    latitude, longitude, latest_seen, last_scanned 
FROM rocketmapdb.spawnpoint;

The error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTEGER), latitude, longitude, latest_seen, last_scanned FROM rocketmapdb.spawnp' at line 1

sql version: mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using EditLine wrapper

Any idea what I'm doing wrong?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

1
INSERT IGNORE INTO epdbraid.spawnpoints ( 
    id, spawn_id, lat, lon, despawn_time, updated 
) 
SELECT 
    0, 
    CAST(CONV(id,16,10) AS  UNSIGNED ), 
    latitude, longitude, latest_seen, last_scanned 
FROM rocketmapdb.spawnpoint;

You can try above code.

halfer
  • 19,824
  • 17
  • 99
  • 186
Sagar Gangwal
  • 7,544
  • 3
  • 24
  • 38