Hey i want to write a function in sql which insert the handover parameters. My Code:
CREATE PROCEDURE `p_add_client`(IN p_username VARCHAR(45),IN p_reach VARCHAR(45),IN p_purchase VARCHAR(45))
BEGIN
set @str = ('INSERT INTO t_', p_username,'(Purchase,Reach) VALUES (p_purchase,p_reach)');
prepare stmt from @str;
execute stmt;
deallocate prepare stmt;
but it doesnt work. I get the error Code 1064. Can anyone help me?