Hi,
In my Project there is a requirement to write a trigger on a Table (eis_batchmessage) having columns (Id,userids,Mobiles,Message,MarylinID,Processed,TableNumber).
The column userids,Mobiles,MarylinID contains multiple value separated by comma like
for userid is : "1427,4589,2358"
for Mobiles is : "91992673545,9176635522,9176342322"
I have another table (mymessage) having columns (id,userid,mobiles,message,marylinid)
When data insert into eis_batchmessage then after insert trigger will fire and comma separate value will split and insert into the mymessage table.
Can anybody help me to write/complete my trigger. I am facing problem in spiting the value and inserting.
My so far code is below
create trigger ins_BachProcess_trig after insert on eis_batchmessage
for each row
BEGIN
Select NEW.Id, NEW.userids, NEW.Mobiles, NEW.Message, NEW.MarylinID, NEW.Processed, NEW.TableNumber from eis_batchmessage;
call InsertBatch()
END;
CREATE PROCEDURE InsertBatch()
BEGIN
DECLARE cur1 CURSOR FOR Id,userids,Mobiles,Message,MarylinID,Processed,TableNumber from eis_batchmessage
DECLARE v_id BIGINT;
DECLARE v_userid TEXT;
DECLARE v_Mobiles TEXT;
DECLARE v_Message varchar(260);
DECLARE v_Marylinid BIGINT;
DECLARE v_processed INT;
DECLARE v_tableno INT;
OPEN cur1;
CLOSE cur1;
END