Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

LOAD command for importing data

Quote Reply
LOAD command for importing data
One of the questions people have had is how to import data into Links. MySQL has a LOAD command that takes care of that. The basic syntax for a Links 2.0 import file would be:

Code:
LOAD DATA [LOCAL] INFILE '/full/path/to/file'
[REPLACE|IGNORE] INTO TABLE Links.Table
FIELDS TERMINATED BY '|'
(comma,separated,list,of,fields,you,are,importing)
;

REPLACE will over write the existing data, IGNORE will ignore the new values and keep the old.

The [LOCAL] parameter is necessary if you are on a remote machine, and doesn't hurt if you aren't.

There are other delimiters for enclosing fields and ending lines, the defaults work fine for Links 2.0 no ' or " in string fields only | as field terminator.

Hope this helps someone.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Subject Author Views Date
Thread LOAD command for importing data pugdog 7536 Jan 11, 2000, 11:18 PM
Post Re: LOAD command for importing data
rover 7416 Jan 12, 2000, 10:15 AM
Post Re: LOAD command for importing data
pugdog 7409 Jan 12, 2000, 4:34 PM
Post Re: LOAD command for importing data
pugdog 7409 Jan 12, 2000, 4:52 PM
Post Re: LOAD command for importing data
carfac 7408 Jan 14, 2000, 8:04 AM
Post Re: LOAD command for importing data
Alex 7426 Jan 14, 2000, 10:32 AM
Post Re: LOAD command for importing data
carfac 7427 Jan 14, 2000, 12:21 PM
Post Re: LOAD command for importing data
carfac 7416 Jan 14, 2000, 12:25 PM
Post Re: LOAD command for importing data
pugdog 7417 Jan 14, 2000, 1:56 PM
Post Re: LOAD command for importing data
carfac 7412 Jan 14, 2000, 7:49 PM
Post Re: LOAD command for importing data
pugdog 7415 Jan 14, 2000, 8:14 PM
Thread Re: LOAD command for importing data
jackofnone 7306 Nov 15, 2000, 12:34 AM
Thread Re: LOAD command for importing data
pugdog 7310 Nov 15, 2000, 12:37 AM
Post Re: LOAD command for importing data
jackofnone 7291 Nov 15, 2000, 1:13 AM