Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
drop trigger IF EXISTS get_value;

delimiter //
CREATE TRIGGER get_value
    AFTER INSERT
    ON t_vh
    FOR EACH ROW
BEGIN
declare vh_id varchar(50);
declare unitid varchar(50);
set vh_id= new.vh_id;
set unitid= new.unitid;
CALL create_table(vh_id,unitid);
end //
delimiter ;


What I have tried:

drop trigger IF EXISTS get_value;

delimiter //
CREATE TRIGGER get_value
    AFTER INSERT
    ON t_vh
    FOR EACH ROW
BEGIN
declare vh_id varchar(50);
declare unitid varchar(50);
set vh_id= new.vh_id;
set unitid= new.unitid;
CALL create_table(vh_id,unitid);
end //
delimiter ;
Posted
Updated 16-Sep-22 1:45am

1 solution

Without access to your DB we can't be sure, but I'd say you need to look at your stored procedure create_table.
I'd guess that it's got an EXEC command in it, and you can't execute them from a trigger.
 
Share this answer
 
Comments
Diksha Adewar 16-Sep-22 7:48am    
is there another way to dynamic creation possible??
OriginalGriff 16-Sep-22 8:30am    
No, you cannot EXEC while handling a trigger.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900