Mike Tuller <[EMAIL PROTECTED]> wrote:
> I am trying write a shell script to check to see if a record exists and if
> it does, update information, and if it doesn't insert information. Is there
> a way to do an if else statement in MySql?
>
If you have PRIMARY KEY or UNIQUE index, take a look at REPLACE and INSERT .. ON
DUPLICATE KEY UPDATE statements:
http://www.mysql.com/doc/en/REPLACE.html
http://www.mysql.com/doc/en/INSERT.html
INSERT .. ON DUPLICATE KEY UPDATE is supported since v4.1.0.
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]