MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:zzapper Date:May 11 2005 10:44am
Subject: Re: query to lowercase database columns names
View as plain text  
On Wed, 11 May 2005 12:22:21 +0200,  wrote:

>Hi,
>this is the idea,
>
>mysql> create table t (01_t varchar(10));
>ERROR 1046 (3D000): No database selected
>mysql>
>mysql> use world
>Database changed
>mysql> create table t (01_t varchar(10));
>Query OK, 0 rows affected (0.20 sec)
>
>mysql>
>mysql>
>mysql> desc t
>    -> ;
>+-------+-------------+------+-----+---------+-------+
>| Field | Type        | Null | Key | Default | Extra |
>+-------+-------------+------+-----+---------+-------+
>| 01_t  | varchar(10) | YES  |     | NULL    |       |
>+-------+-------------+------+-----+---------+-------+
>1 row in set (0.01 sec)
>
>mysql> alter table t change 01_t something_01_t varchar(15);
>Query OK, 0 rows affected (0.17 sec)
>Records: 0  Duplicates: 0  Warnings: 0
>
>mysql> desc t
>    -> ;
>+----------------+-------------+------+-----+---------+-------+
>| Field          | Type        | Null | Key | Default | Extra |
>+----------------+-------------+------+-----+---------+-------+
>| something_01_t | varchar(15) | YES  |     | NULL    |       |
>+----------------+-------------+------+-----+---------+-------+
>1 row in set (0.00 sec)
>
>
>Scripting this query on all tables, and all columns from a perl or php script
>can help you
>
Mathias

Yes of course I can use Perl to generate a multiple MySQL Alter script rather than
actually doing it
via say Perl:DBI::MySQL

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips

Thread
query to lowercase database columns nameszzapper9 May
  • Re: query to lowercase database columns nameszzapper11 May
    • Re: query to lowercase database columns namesmfatene11 May
  • Re: query to lowercase database columns nameszzapper11 May
RE: Re: query to lowercase database columns namesJay Blanchard11 May
  • RE: Re: query to lowercase database columns namesmfatene11 May
  • Re: query to lowercase database columns nameszzapper12 May