0

尝试更改 Mysql Workbench 中的视图时出现错误。观点是:

CREATE VIEW `ct_objects_v` AS
SELECT 
    *
from
    ct_objects as ct_o
where
    exists( select 
            1
        from
            um_appl_restriction_list as um_rl
        where
            ct_o.ID = um_rl.OBJ_ID
                and um_rl.OBJECT_TYPE = 'CT_OBJECTS')

当改变它时,我得到“错误解析 DDL for ...”:

    delimiter $$

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ct_objects_v` AS 
select `ct_o`.`ID` AS `ID`,`ct_o`.`NAME` AS `NAME`,`ct_o`.`MAP` AS `MAP`,`ct_o`.`DESCR` AS `DESCR`,`ct_o`.`ADRESS` AS `ADRESS`,`ct_o`.`NT_CITY_ID` AS `NT_CITY_ID`,`ct_o`.`CT_CATEGORY_ID` AS `CT_CATEGORY_ID`,`ct_o`.`WORKTIME` AS `WORKTIME`,`ct_o`.`INETADRESS` AS `INETADRESS`,`ct_o`.`CONTACTS` AS `CONTACTS` from `ct_objects` `ct_o` where exists(select 1 AS `1` from `um_appl_restriction_list` `um_rl` where ((`ct_o`.`ID` = `um_rl`.`OBJ_ID`) and (`um_rl`.`OBJECT_TYPE` = _cp1251'CT_OBJECTS')))$$

SQL 编辑器将我指向“CT_OBJECTS”作为错误提示:“语法错误,意外的 STRING_TEXT”。

4

1 回答 1

0

我将表“um_appl_restriction_list”的字符集更改为“utf8”,现在可以使用了。

于 2013-09-22T08:54:05.000 回答