Can create procedure in Dynamic SQL Teradata

Database

Can create procedure in Dynamic SQL Teradata

Please, help with this procedure.

 

replace procedure test_proc(inp varchar(10))
begin
DECLARE VV varchar(64000);
set VV='
replace procedure test_proc23()
SPBEGIN:
BEGIN
DECLARE out1 varchar(500);
DECLARE out2 integer;
call TD_SYSXML.XMLPUBLISH('' sel * from Name'', null,:out1,:out2);
insert into svt24'||inp||' values (:out1,:out2);
END SPBEGIN;';
EXECUTE IMMEDIATE VV;
end;

 

ERROR: TEST_PROC:Syntax error: Invalid  SQL Statement. 

 

Does is possible to create a procedure to dynamically in Teradata? Or how to correct this code?