IF EXISTS other table
Posted: Wed Feb 11, 2004 8:33 pm
Lets say I have two mysql tables:
CurrentTable
NewTable
After NewTable has been created I have a script that DROPs CurrentTable
and then RENAMEs NewTable TO CurrentTable
Is there a way to check to be sure that NewTable EXISTS before I DROP CurrentTable?
The IF EXISTS TABLE syntax seems to only check if the table you want to drop exists (not check if some OTHER table exists)
I am a newbie, so if i read this wrong, can someone please tell me how to adjust the command to do what I need.
Thanks,
--Tim
CurrentTable
NewTable
After NewTable has been created I have a script that DROPs CurrentTable
and then RENAMEs NewTable TO CurrentTable
Is there a way to check to be sure that NewTable EXISTS before I DROP CurrentTable?
The IF EXISTS TABLE syntax seems to only check if the table you want to drop exists (not check if some OTHER table exists)
I am a newbie, so if i read this wrong, can someone please tell me how to adjust the command to do what I need.
Thanks,
--Tim