Hello!
I need to execute a dynamic RUNSTATS in a stored procedure, but itīs not working...
the error message is:
SQL0104N An unexpected token "TABLE" was found following "RUNSTATS ON ".
Expected tokens may include: "JOIN". SQLSTATE=42601
My stored procedure is:
PREPARE V_SQL_C1 FROM V_COMANDO;
SET V_COMANDO2 = "RUNSTATS ON TABLE EPI03.DBM_ATIVIDADE_ETL";
SET V_COMANDO3 = " WITH DISTRIBUTION AND INDEXES ALL";
SET V_COMANDO = V_COMANDO2 || V_COMANDO3;
EXECUTE V_COMANDO;
Whatīs the problem??
Thanks,
Tessy