AW: One question

AW: One question

am 19.10.2007 16:27:27 von Gisbert.Selke

> -----Ursprüngliche Nachricht-----
> Von: Armando Gomez [mailto:armando.gomez@aaahmt.com]
> Gesendet: Freitag, 19. Oktober 2007 15:55
> I have a question I am working on a project that require do=20
> some access to a
> MySql database one of those queries that is very simple=20
> something like this
> SELECT * FROM pat WHERE pat =3D "BEEK"=20
> Since I am a complete newbie on this subject how can I make=20
> with the data turn it into a new table in mySql?
CREATE TABLE foo AS SELECT * FROM pat WHERE pat =3D "BEEK"
=20
> 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

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

RE: One question

am 19.10.2007 16:35:50 von Armando Gomez

Yes I did I am using DBI to connect to my database :o)


Thanks=20




-----Mensaje original-----
De: Selke, Gisbert W. [mailto:Gisbert.Selke@wido.bv.aok.de]=20
Enviado el: Viernes, 19 de Octubre de 2007 09:27 a.m.
Para: 'Armando Gomez'
CC: perl@lists.mysql.com
Asunto: AW: One question=20

> -----Ursprüngliche Nachricht-----
> Von: Armando Gomez [mailto:armando.gomez@aaahmt.com]
> Gesendet: Freitag, 19. Oktober 2007 15:55
> I have a question I am working on a project that require do=20
> some access to a
> MySql database one of those queries that is very simple=20
> something like this
> SELECT * FROM pat WHERE pat =3D "BEEK"=20
> Since I am a complete newbie on this subject how can I make=20
> with the data turn it into a new table in mySql?
CREATE TABLE foo AS SELECT * FROM pat WHERE pat =3D "BEEK"
=20
> 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

--=20
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:
http://lists.mysql.com/perl?unsub=3Darmando.gomez@aaahmt.com


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org