Loading a tabel with extract from another tabbe!?

This is a discussion on Loading a tabel with extract from another tabbe!? within the MySQL Database forums, part of the Database Forums category; I would like to extract a list of entries from on table (t1 ) based on a field TIMESTAMP to a ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-09-2007
zoot
 
Posts: n/a
Default Loading a tabel with extract from another tabbe!?

I would like to extract a list of entries from on table (t1 ) based on
a field TIMESTAMP to a file reayd to be loaded into another database.
Say something like
select * into dumpfile entries from t1 where date like
'2007-11-09%' ( so extract all from table t1 done today )

on the other database I would like to

mysql -p < entries ( maybe either edit the file to specify the
databae /table or maybe some options )

from select * into dumpfile I got an error 'multiple row '
If I do a select * into outfile I have a file with every needed
entries But the format doesn't allo a reload!
Any idea ?
Many thanks in advance for your time.
Zoot

Reply With Quote
  #2 (permalink)  
Old 11-09-2007
Captain Paralytic
 
Posts: n/a
Default Re: Loading a tabel with extract from another tabbe!?

On 9 Nov, 14:40, zoot <a...@swing.be> wrote:
> I would like to extract a list of entries from on table (t1 ) based on
> a field TIMESTAMP to a file reayd to be loaded into another database.
> Say something like
> select * into dumpfile entries from t1 where date like
> '2007-11-09%' ( so extract all from table t1 done today )
>
> on the other database I would like to
>
> mysql -p < entries ( maybe either edit the file to specify the
> databae /table or maybe some options )
>
> from select * into dumpfile I got an error 'multiple row '
> If I do a select * into outfile I have a file with every needed
> entries But the format doesn't allo a reload!
> Any idea ?
> Many thanks in advance for your time.
> Zoot


Look at the parameters for mysqldump. You can offer it a query

Reply With Quote
  #3 (permalink)  
Old 11-09-2007
zoot
 
Posts: n/a
Default Re: Loading a tabel with extract from another tabbe!?

On 9 nov, 16:23, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 9 Nov, 14:40, zoot <a...@swing.be> wrote:
>
>
>
> > I would like to extract a list of entries from on table (t1 ) based on
> > a field TIMESTAMP to a file reayd to be loaded into another database.
> > Say something like
> > select * into dumpfile entries from t1 where date like
> > '2007-11-09%' ( so extract all from table t1 done today )

>
> > on the other database I would like to

>
> > mysql -p < entries ( maybe either edit the file to specify the
> > databae /table or maybe some options )

>
> > from select * into dumpfile I got an error 'multiple row '
> > If I do a select * into outfile I have a file with every needed
> > entries But the format doesn't allo a reload!
> > Any idea ?
> > Many thanks in advance for your time.
> > Zoot

>
> Look at the parameters for mysqldump. You can offer it a query


Many thanks, But I should have better read the F..g manual.
The intersssting part is the 'LOAD DATA INFILE '/usr/mysql/temp/
blblab' INTO TABLE xyz;

it take data ( in file ) created from a SELECT * INTO OUTFILE '/usr/
mysql/temp/blblab' from TABLE xyz;
as easy as that!
Many thanks again
Zoot

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:31 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0