List:MySQL and Perl« Previous MessageNext Message »
From:Gisbert W. Selke Date:October 19 2007 2:27pm
Subject:AW: One question
View as plain text  
> -----Ursprüngliche Nachricht-----
> Von: Armando Gomez [mailto:armando.gomez@stripped]
> Gesendet: Freitag, 19. Oktober 2007 15:55
> I have a question I am working on a project that require do 
> some access to a
> MySql database one of those queries that is very simple 
> something like this
> SELECT * FROM pat WHERE pat = "BEEK" 
> Since I am a complete newbie on this subject how can I make 
> with the data turn it into a new table in mySql?
CREATE TABLE foo AS SELECT * FROM pat WHERE pat = "BEEK"
 
> Oh ! I almost forgot in perl how can I empty a table?
$dbh->do("TRUNCATE TABLE foo");
or
$dbh->do("DELETE FROM foo")

(assuming that you have previously obtained a database handle $dbh for your
database connection, as per the man pages for DBI and DBD::mysql, which I
assume you have studied.)

\Gisbert
Thread
One question Armando Gomez19 Oct
AW: One question Gisbert W. Selke19 Oct
  • RE: One question Armando Gomez19 Oct