On Fri, 2003-06-20 at 12:16, Barbara Andrew wrote:

<snip>
> I have three books on mySQL, they all talk about how to
> construct SQL statements and I'm fine with that. What I can't figure out is
> how to get those statements to the right place without having to do it
> manually.

This would be the domain of some other tool, such as a shell script, or
a commandline php/python/perl etc script that could be run nightly using
a scheduling tool ie cron, at etc.  You could also have mysql do the
import:


use databasename;
drop table if exists myTable;
create table myTable (
        Field1 varchar(50) not null,
        field2 varchar(25) not null,
        PRIMARY KEY (Field1),
        KEY names(field2)
        )
        TYPE=MyISAM;
load data infile '/tmp/dataFile' into table myTable FIELDS TERMINATED BY
'|';


put the above (or some variation) in a file (filename.mysql), and then
have mysql execute those statements nightly:

by putting the following into either a one line bash script, or having
cron run it directly: 

mysql filename.mysql 


Of course, you will probably want to run some checks to make sure the
data is in the file before you start Dropping tables etc.  Check these
out for reference: 

http://www.mysql.com/doc/en/mysqlimport.html

http://www.mysql.com/doc/en/LOAD_DATA.html



hth,
gabe. 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to