One Star

Use a EXEC DBMS_STATS in a tOracleRow or another component ?

Hello,
Is it possible to do an "exec dbms_stats" with a Talend job ?
I am trying to execute this statement:
"EXEC DBMS_STATS.GATHER_SCHEMA_STATS('my_schema', cascade=>TRUE)"
with a tOracleRow but I get the error ORA-00900: invalid SQL Statement. It's the same with a ; at the end of the line.
When I execute this statement in SQLPlus/TOAD it works fine.
I'm on Oracle 11g, and Talend 4.0.3.
Any idea please ?
Thx in advance !
Sorry for my english.. Smiley Happy
2 REPLIES
One Star

Re: Use a EXEC DBMS_STATS in a tOracleRow or another component ?

I created a stored proc then call it using the tOracle SP operator: CREATE OR REPLACE PROCEDURE REFRESH_STATS
(in_table_name varchar2)
as
BEGIN
DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'BI_DM', TABNAME => in_table_name, CASCADE => TRUE, ESTIMATE_PERCENT => 100, DEGREE => DBMS_STATS.AUTO_DEGREE);
END;
/
One Star tpk
One Star

Re: Use a EXEC DBMS_STATS in a tOracleRow or another component ?

Hi,
Just remove the EXEC command and type the remaining part of the statement with ";". Your wish will be fulfilled.
Cheers!
Thanks and Regards,
Pavan
Hello,
Is it possible to do an "exec dbms_stats" with a Talend job ?
I am trying to execute this statement:
"EXEC DBMS_STATS.GATHER_SCHEMA_STATS('my_schema', cascade=>TRUE)"
with a tOracleRow but I get the error ORA-00900: invalid SQL Statement. It's the same with a ; at the end of the line.
When I execute this statement in SQLPlus/TOAD it works fine.
I'm on Oracle 11g, and Talend 4.0.3.
Any idea please ?
Thx in advance !
Sorry for my english.. Smiley Happy