Unix Technical Forum

fill column with external file list

This is a discussion on fill column with external file list within the MySQL forums, part of the Database Server Software category; --> Hello, I have found many tutorials on how to fill a TABLE from an external file with the values ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:47 AM
f-x.p@laposte.net
 
Posts: n/a
Default fill column with external file list

Hello,

I have found many tutorials on how to fill a TABLE from an external
file with the values (not sql, just one value per line see for this:
http://www.mysql.org/doc/refman/5.1/...ng-tables.html ).

My question is: can I fill **just one COLUMN** from a table, with such
a file?

Thank you for any hint.

François

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:47 AM
Paul Lautman
 
Posts: n/a
Default Re: fill column with external file list

f-x.p@laposte.net wrote:
> Hello,
>
> I have found many tutorials on how to fill a TABLE from an external
> file with the values (not sql, just one value per line see for this:
> http://www.mysql.org/doc/refman/5.1/...ng-tables.html ).
>
> My question is: can I fill **just one COLUMN** from a table, with such
> a file?
>
> Thank you for any hint.
>
> François


Yes, see the page
http://www.mysql.org/doc/refman/5.1/en/load-data.html
in the same manual.

Particularly this paragraph:
"By default, when no column list is provided at the end of the LOAD DATA
INFILE statement, input lines are expected to contain a field for each table
column. If you want to load only some of a table's columns, specify a column
list:
LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata (col1,col2,...);"


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:48 AM
f-x.p@laposte.net
 
Posts: n/a
Default Re: fill column with external file list

Really Thank you Paul,

this is exactly what I was looking for. Sorry I didn't read the
complete manual carefully enough.

Thanks again

François

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com