真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

MySQLcreatefunction時報錯

MySQL create function時報錯
mysql> delimiter $$
mysql> CREATE FUNCTION is_ChangeDescColumnExist (THE_VERSION_LEVEL_TABLE_NAME VARCHAR(35)) RETURN INT DETERMINISTIC
    ->     BEGIN
    -> DECLARE nbr INT;
    ->     SET nbr =0;
    -> /*        DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN 0;*/
    ->         select count(*) into nbr from information_schema.columns where table_name = THE_VERSION_LEVEL_TABLE_NAME and
    ->         (column_name ='C_CHANGE_DESCRIPTION');
    ->         IF nbr = 1 THEN
    ->             RETURN 1;
    ->         ELSE
ELSE    ELSEIF  
    ->         ELSE
    ->             RETURN 0;
    ->         END IF;
    ->     END$$
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN INT DETERMINISTIC
    BEGIN
DECLARE nbr INT;
    SET nbr =0;

        sel' at line 1

報錯原因:
RETURN INT DETERMINISTIC語句中返回關(guān)鍵字應(yīng)該是RETURNS

修改后,創(chuàng)建函數(shù)正常
delimiter $$
CREATE FUNCTION is_ChangeDescColumnExist (THE_VERSION_LEVEL_TABLE_NAME VARCHAR(35)) RETURNS INT DETERMINISTIC
    BEGIN
    DECLARE nbr INT;
    SET nbr =0;
/*        DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN 0;*/
        select count(*) into nbr from information_schema.columns where table_name = THE_VERSION_LEVEL_TABLE_NAME and
        (column_name ='C_CHANGE_DESCRIPTION');
        IF nbr = 1 THEN
            RETURN 1;
        ELSE        
            RETURN 0;
        END IF;
    END$$

標(biāo)題名稱:MySQLcreatefunction時報錯
當(dāng)前URL:http://weahome.cn/article/gdoiod.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部