List:General Discussion« Previous MessageNext Message »
From:Jan Steinman Date:April 5 2012 4:04pm
Subject:Re: create multiple tables in a single query
View as plain text  
> From: joe j <joe.stata@stripped>
> 
> Thanks. I was looking for a loop--not to gain speed but to reduce the
> length of my script file:) I'll try and hopefully it will work!

Is there any reason (besides human keystrokes) that you want a short script?

If not, how 'bout the best of both worlds: create a UNIX (or perl) script that loops
through the country names and creates an SQL script? That would be fast entering AND fast
performing!

> J
> 
> On Wed, Apr 4, 2012 at 12:16 PM, Johan De Meersman <vegivamp@stripped> wrote:
>> ----- Original Message -----
>>> From: "joe j" <joe.stata@stripped>
>>> 
>>> So what I am trying to get is a script that runs through a list of
>>> country names (US, UK, NL, etc) and create tables for each one of
>>> them as above. Is this feasible in MySql?
>> 
>> You can't create multiple tables with one statement; but you *can* put multiple
> statements on a single line. However, this does nothing for performance - nor readabiltiy,
> for that matter :-)
>> 
>> You could (on *nix) write a simple commandline loop for it, I suppose. Something
> along the lines of
>> 
>> for x in UK US BE FR; do mysql -e "create table ${x}_table_new as select
> blahblahblbah"; done

----------------
Expose yourself to your deepest fear; after that, fear has no power, and the fear of
freedom shrinks and vanishes. You are free. -- Jim Morrison
:::: Jan Steinman, EcoReality Co-op ::::




Thread
create multiple tables in a single queryjoe j3 Apr
  • Re: create multiple tables in a single queryhsv4 Apr
    • Re: create multiple tables in a single queryRick James4 Apr
      • Re: create multiple tables in a single queryJohan De Meersman5 Apr
  • Re: create multiple tables in a single queryJohan De Meersman4 Apr
    • Re: create multiple tables in a single queryjoe j4 Apr
      • Re: create multiple tables in a single queryjoe j4 Apr
        • Re: create multiple tables in a single queryJohan De Meersman5 Apr
          • Re: create multiple tables in a single queryjoe j5 Apr
            • Re: create multiple tables in a single queryjoe j5 Apr
              • Re: create multiple tables in a single queryJohan De Meersman6 Apr
        • Re: create more tables in a single queryhsv5 Apr
Re: create multiple tables in a single queryJan Steinman5 Apr