How to return a MySQL procedure as a trigger? -


i'm new mysql procedures. need emulate code plpgsql, this:

drop function if exists "aprtr_controlo_tabelas_ins_upd" () cascade; create or replace function "aprtr_controlo_tabelas_ins_upd" ()          returns trigger  $body$         begin             if (tg_op = 'insert')                 new.data_ult_actual := current_timestamp;                 new.id_utiliz_ins := current_user;             return new;             elseif (tg_op = 'update')                 new.data_ult_actual := current_timestamp;                 new.id_utiliz_upd := current_user;             return new;             end if;              return null;         end; $body$         language plpgsql         called on null input         volatile         external security definer;  

it possible in mysql write procedures return trigger? or better, can use procedure code , call trigger in operation of insert or update?

best regards,

mysql supports specific data types function return types. per mysql documentation trigger not data type. custom objects data types not feature afaik. supported data types detailed here.

referene: mysql create function syntax.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -