unable to create trigger on mysql 5.0.18[solved]
Posted: Tue May 09, 2006 6:21 am
I am unable to create a trigger on mysql 5.0.18-standard-log but I was able to create a trigger using the same code on mysql 5.0.15-log.
error:
Code: Select all
trigger code:
delimiter //
drop trigger OnlineSystem.on_address_disabled//
create trigger OnlineSystem.on_address_disabled
after update on AddressBook
for each row
begin
declare m_noAddressId int default NULL;
/* If an address is disabled, then all shopping cart lines pointing to that address must point */
/* to 'No Address' value */
if ( NEW.addressStatus = 'disabled' ) then
/* Get the 'No Address' row id */
select
`id` into `m_noAddressId`
from
`AddressBook`
where
lcase(`name`) = 'no address';
update `ShoppingCartProduct`
set
`AddressBookId` = `m_noAddressId`
where
`AddressBookId` = NEW.id;
end if;
end;
//error:
Code: Select all
definer not fully qualified