> -----Original Message----- > From: Scott Pham [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 28, 2004 12:55 PM > To: Perl Beginners List > Cc: Christopher Lyon > Subject: Re: Moving Data from one table to another table > > Depending on what database platform you are using, you can easily do > > "SELECT * into new_table from table; >
So, just the select * into.... will replace the entire select * from... and then a insert into....? I can rip out the while statement and just do this select and the delete. That might fix the problem. > > On Tue, 28 Dec 2004 15:50:41 -0500 (EST), Chris Devers > <[EMAIL PROTECTED]> wrote: > > On Tue, 28 Dec 2004, Chris Lyon wrote: > > > > > So, I am trying to move data from one sql table to another table > > > called logs_archive. It seems that I am running into some problems > > > with memory as I am moving this much data from one table to another. > > > This is just syslog data but we need to archive it in some way. Can > > > anybody give any advice? Code is below. > > > > You're archiving syslog data? > > > > Then why pump it into a database to begin with? > > > > Log data `bzip`s wonderfully well, you know... > > > > > $sth = $dbh->prepare( "select * from logs where ( timestamp <= > > > '$start_date$start_time' )" ); > > > > If you stub in values for $start_date and $start_time, what happens when > > you run this statement directly to your database? > > > > You don't mention what database server you're running, but in the SQL > > dialects I'm familiar with, '<=' isn't a valid operator I'm aware of. > > > > In any case, you don't really spell out what the problem is. Does this > > code work, but run too slowly, or does it not work at all? What happens > > when you run this script? > > > > -- > > Chris Devers > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>