MySQL stored procedures

Source: Internet
Author: User

A case of MySQL stored procedure

DROP PROCEDURE IF EXISTS saveorupdate_sub_key_proc; CREATE PROCEDURE Saveorupdate_sub_key_proc (in Sub_id_argint(4), in English_arg varchar ( -), in Hindi_arg varchar ( -), in Marathi_arg varchar ( -), in Tamil_arg varchar ( -)) Begindeclare Count_sub_item INT (4); SelectCOUNT (*) into Count_sub_item fromSubject_keywordswheresub_id =Sub_id_arg; ifCount_sub_item >0Then update Subject_keywordsSet中文版 = English_arg,hindi = Hindi_arg,marathi = Marathi_arg,tamil = Tamil_argwheresub_id =Sub_id_arg; ELSE INSERT INTO Subject_keywords (sub_id,english,hindi,marathi,tamil) VALUES (Sub_id_arg,english_arg,hindi_arg,    MARATHI_ARG,TAMIL_ARG); Endif; SelectCount_sub_item; End;call Saveorupdate_sub_key_proc (412,' A','AA','cc','DD');

MySQL stored procedures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.