List:MySQL and Perl« Previous MessageNext Message »
From:Darren Duncan Date:March 30 2011 6:14pm
Subject:Re: MySQL queries in a relational database
View as plain text  
francesca casalino wrote:
> I am now having trouble with generating a query in Perl DBI to take data
> from this database and insert it into another table in MySQL; I am still
> just at the start in learning both MySQL and Perl, and sorry if this is a
> simple question again, but I have been stuck on this for a while now…if you
> have any advice on how to tackle this please let me know.

I don't know if you're already doing this, but you may be able to do your SELECT 
and INSERT as a single SQL statement, which is simpler than pulling your data 
out to Perl and pushing it in again.

   insert into mytbl (mycol1, mycol2)
   select mycol1, mycol2 ... <ordinary select statement continues>

-- Darren Duncan
Thread
MySQL queries in a relational databasefrancesca casalino30 Mar
  • Re: MySQL queries in a relational databaseMichael R Boudreau30 Mar
    • Re: MySQL queries in a relational databasefrancesca casalino30 Mar
  • Re: MySQL queries in a relational databaseDarren Duncan30 Mar
    • Re: MySQL queries in a relational databasefrancesca casalino31 Mar
      • Re: MySQL queries in a relational databaseDarren Duncan31 Mar
        • Re: MySQL queries in a relational databasefrancesca casalino31 Mar