Czesc,

Jak wyeksportuje sobie strukture tego widoku mam cos takiego:

CREATE ALGORITHM=UNDEFINED DEFINER=`lms`@`localhost` SQL SECURITY DEFINER VIEW `customersview` AS select `c`.`id` AS `id`,`c`.`lastname` AS `lastname`,`c`.`name` AS `name`,`c`.`status` AS `status`,`c`.`email` AS `email`,`c`.`address` AS `address`,`c`.`zip` AS `zip`,`c`.`city` AS `city`,`c`.`ten` AS `ten`,`c`.`ssn` AS `ssn`,`c`.`info` AS `info`,`c`.`creationdate` AS `creationdate`,`c`.`moddate` AS `moddate`,`c`.`creatorid` AS `creatorid`,`c`.`modid` AS `modid`,`c`.`deleted` AS `deleted`,`c`.`message` AS `message`,`c`.`pin` AS `pin`,`c`.`regon` AS `regon`,`c`.`rbe` AS `rbe`,`c`.`icn` AS `icn`,`c`.`notes` AS `notes`,`c`.`cutoffstop` AS `cutoffstop`,`c`.`consentdate` AS `consentdate`,`c`.`type` AS `type`,`c`.`divisionid` AS `divisionid`,`c`.`paytime` AS `paytime`,`c`.`countryid` AS `countryid`,`c`.`paytype` AS `paytype`,`c`.`einvoice` AS `einvoice`,`c`.`invoicenotice` AS `invoicenotice`,`c`.`mailingnotice` AS `mailingnotice`,`c`.`post_address` AS `post_address`,`c`.`post_zip` AS `post_zip`,`c`.`post_city` AS `post_city`,`c`.`post_countryid` AS `post_countryid`,`c`.`post_name` AS `post_name` from `customers` `c` where (not(exists(select 1 AS `1` from (`customerassignments` `a` join `excludedgroups` `e` on((`a`.`customergroupid` = `e`.`customergroupid`))) where ((`e`.`userid` = `lms_current_user`()) and (`a`.`customerid` = `c`.`id`)))));

Moze warto odtworzyc widok w ten sposob, dodajac tylko jedna kolumne ktora wczesniej dodales do tabeli?


W dniu 30.12.2014 o 13:36, Jacek Brzozowski pisze:
Witam wszystkich serdecznie,

Mam taki problem. Dodawałem kolumnę do tabeli customers. Usunąłem view customerview ( DROP VIEW customersview;) i stworzyłem nowy view:

CREATE VIEW customersview AS
SELECT c.* FROM customers c
         WHERE NOT EXISTS (
                 SELECT 1 FROM customerassignments a
                 JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
                 WHERE e.userid = lms_current_user() AND a.customerid = c.id);

no i niby wszystko ok, ale jak dodaję nowego klienta to go nie dodaje...po wybraniu "Zapisz" zostaję przekierowany na listę klientów. Powiedzcie co zrobiłem nie tak ?

pozdrawiam


-- 
Pozdrawiam, Łukasz Czerepuk
JPK
www.jpk.pl