문제

I getting an error when try to alter view in Mysql Workbench. The view is:

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')

and when alter it i got "Error parsing 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 Editor point me to 'CT_OBJECTS' as error with hint:"Syntax error, unexpected STRING_TEXT".

도움이 되었습니까?

해결책

I change character set of the table 'um_appl_restriction_list' to 'utf8' and it's work now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top