List:General Discussion« Previous MessageNext Message »
From:Shawn Green Date:May 16 2012 3:35pm
Subject:Re: Foreign key and uppercase / lowercase values
View as plain text  
Hello Ananda,

On 5/16/2012 6:42 AM, Ananda Kumar wrote:
> why are not using any where condition in the update statment
>

WHERE clauses are not required. Performing a command without one will 
affect ever row on the table.

> On Wed, May 16, 2012 at 1:24 PM, GF<ganfab@stripped>  wrote:
>
>> Good morning,
>> I have an application where the user ids were stored lowercase.
>> Some batch import, in the user table some users stored  a uppercase
>> id, and for some applicative logic, in other tables that have a
>> foreign key to the user table, their user ids are stored lowercase.
>> ...
>> Have you any idea how to solve this situation without
>> stopping/recreating the DB? (it's a production environment)
>> Thanks
>>

Have you tried ?

   SET foreign_key_checks=0;
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_foreign_key_checks

If that does not work, you would need to first un-create your Foreign 
Key relationships, update your key values (the USER_ID fields), then 
re-create your Foreign Key relationships.

Regards,
-- 
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

Thread
Foreign key and uppercase / lowercase valuesGF16 May
  • Re: Foreign key and uppercase / lowercase valuesAnanda Kumar16 May
    • RE: Foreign key and uppercase / lowercase valuesRick James16 May
    • Re: Foreign key and uppercase / lowercase valuesShawn Green16 May
      • Re: Foreign key and uppercase / lowercase valuesGF12 Jun
        • RE: Foreign key and uppercase / lowercase valuesRick James13 Jun
          • Re: Foreign key and uppercase / lowercase valuesGF15 Jun
            • RE: Foreign key and uppercase / lowercase valuesRick James15 Jun
              • Re: Foreign key and uppercase / lowercase valuesShawn Green15 Jun
                • RE: Foreign key and uppercase / lowercase valuesRick James15 Jun
                  • Re: Foreign key and uppercase / lowercase valuesShawn Green15 Jun
                    • Re: Foreign key and uppercase / lowercase valuesWalter Tross15 Jun
              • Re: Foreign key and uppercase / lowercase valuesGF18 Jun