I have the exact same problem as this with DataStage Server 8.1
I have tried to execute the following code from the "Before" tab of the SQL statement in the Oracle Stage:
Code: Select all
exec dbms_stats.gather_table_stats(ownname => 'MA_ODS', tabname => 'ODS_ITEM', estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE SKEWONLY', degree => 8, granularity => 'ALL', cascade => TRUE);
Code: Select all
begin
dbms_stats.gather_table_stats[...];
end;
Code: Select all
CALL dbms_stats.gather_table_stats[...];
But I get the same error: ORA-00900: invalid SQL statement
Please note that I have no problem running this with SQL Developer on the same database (Oracle 10g) and with the same user.
Looks like DataStage does not support this ? But isn't DataStage using SQL plus to execute what you enter in the Before/After SQL statement ?
An other project in the company had the same problem, and they used an insert statement in the "before SQL" to execute a trigger instead. But we can't do the same, because we had a no go from our Database admins to use this method.
Thanks for your help !
![Smile :)](./images/smilies/icon_smile.gif)