|
|
|
| подскажите где здесь может быть ошибка синтаксиса???
BEGIN;
SET FOREIGN_KEY_CHECKS = 0;
DROP TRIGGER `sub`
DROP TRIGGER `ad`
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`, `creation`)
VALUES (29, 2, 'Create a "New Sales" report that would list
all new paid account sales by date and by rep along with
the # of categories they have paid listings in',
'2005-02-07 16:19:06')
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`,
`creation`) VALUES (31, 2, 'Allow to designate in account
contacts who would show up in the RFI/lead notification
window', '2005-02-07 19:04:16')
CREATE TRIGGER `sub` AFTER INSERT ON `issues`
FOR EACH ROW
begin
set @tot = 1;
end
CREATE TRIGGER `ad` BEFORE INSERT ON `issues`
FOR EACH ROW
begin
set @tot = 0;
end
SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
|
Пишет :
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 ';
SET FOREIGN_KEY_CHECKS = 0
DROP TRIGGER `sub`
DROP TRIGGER `ad`
INSERT I' at line 1
И если знаете, примерчик кода, как прально... | |
|
|
|
|
|
|
|
для: charodej
(08.04.2008 в 11:55)
| | А почему после
Точки с запятой нет?
Вы где этот запрос выполняете? | |
|
|
|
|
|
|
|
для: cheops
(08.04.2008 в 12:52)
| | запрос создан чисто в учебных целях, выполняю в MySQL Query Browser 1.1
запятые и ставил, и не ставил и много чего перепробывал, ну с точки зрения языка он верен, не считая ";"???
не выполняется даже запрос
begin;
set FOREIGN_KEY_CHECKS = 0;
drop trigger `issues`.`sub`;
set FOREIGN_KEY_CHECKS = 1;
commit;
|
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 ';
set FOREIGN_KEY_CHECKS = 0;
drop trigger `issues`.`sub`;
set FOREIGN_KEY_CHE' at line 1
| |
|
|
|
|
|
|
|
для: charodej
(08.04.2008 в 15:37)
| | BEGIN;
SET FOREIGN_KEY_CHECKS = 0;
DROP TRIGGER `sub`;
DROP TRIGGER `ad`;
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`, `creation`)
VALUES (29, 2, 'Create a "New Sales" report that would list
all new paid account sales by date and by rep along with
the # of categories they have paid listings in',
'2005-02-07 16:19:06') ;
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`,
`creation`) VALUES (31, 2, 'Allow to designate in account
contacts who would show up in the RFI/lead notification
window', '2005-02-07 19:04:16') ;
CREATE TRIGGER `sub` AFTER INSERT ON `issues`
FOR EACH ROW
begin
set @tot = 1;
end;
CREATE TRIGGER `ad` BEFORE INSERT ON `issues`
FOR EACH ROW
begin
set @tot = 0;
end;
SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
так работает? | |
|
|
|
|
|
|
|
для: ronin80
(09.04.2008 в 16:02)
| | нет, так не работает
видимо потому, что выполняю в query browser? а там может с транзакциями своя фишка, выполняются как-то через кнопочки... не знаю....
работает в ком строке вот так:
BEGIN;
SET FOREIGN_KEY_CHECKS = 0;
DROP TRIGGER `issue`.`sub`;
DROP TRIGGER `issue`.`ad`;
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`, `creation`)
VALUES (0, 2, 'Create a "New Sales" report that would list
all new paid account sales by date and by rep along with
the # of categories they have paid listings in',
'2005-02-07 16:19:06') ;
INSERT INTO `issue`.`issues`(`id`, `projectid`, `title`,
`creation`) VALUES (0, 2, 'Allow to designate in account
contacts who would show up in the RFI/lead notification
window', '2005-02-07 19:04:16') ;
CREATE TRIGGER `issue`.`sub` AFTER INSERT ON `issue`.`issues`
FOR EACH ROW
begin
end;
CREATE TRIGGER `issue`.`ad` BEFORE INSERT ON `issue`.`issues`
FOR EACH ROW
begin
end;
SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
причем, если изменить тело триггера на
begin
set @tot = 1;
end;
то ругается на синтаксическую ошибку, интересно в чем она??? | |
|
|
|