Hello All
I'm trying to fire the following RUNSTATS command from SQL>After in DB2 API stage:
RUNSTATS on BKH.CNTAC with distribution and sampled detailed indexes all allow write access;
Same command executes successfully when fired from DB2 client. But it's throwing warnings when run from DataStage:
db2_SALES_CNTAC_TRAN_ins,0: Warning: djp_SALES_CNTAC_TRAN.db2_SALES_CNTAC_TRAN_ins: SQLExecDirect: Error executing statement '
RUNSTATS on table BKH.CNTAC with distribution and sampled detailed indexes all allow write access'. See following DB2 message for details.
db2_SALES_CNTAC_TRAN_ins,0: Warning: djp_SALES_CNTAC_TRAN.db2_SALES_CNTAC_TRAN_ins: [IBM][CLI Driver][DB2/AIX64] SQL0104N An unexpected token "table" was found following "RUNSTATS on ". Expected tokens may include: "JOIN". SQLSTATE=42601
I don't think anything wrong with the command syntax since I'm able to run it from DB2 client.
Any help would be appreciated. Thanks!
Error running RUNSTATS from DB2 API stage
Moderators: chulett, rschirm, roy
Error running RUNSTATS from DB2 API stage
Nitin Jain | India
If everything seems to be going well, you have obviously overlooked something.
If everything seems to be going well, you have obviously overlooked something.
-
- Premium Member
- Posts: 99
- Joined: Mon Sep 03, 2007 7:49 am
- Location: Stockholm, Sweden
You can only issue commands from DB2 API stage that is valid SQL and can be run from any SQL-editor. RUNSTATS in DB2 is a database command and therefore it cannot be run in db2 api stage.
Use db2 enterprise stage open and close command instead. It can issue sql and databse commands.
Use db2 enterprise stage open and close command instead. It can issue sql and databse commands.
-------------------------------------
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
-
- Premium Member
- Posts: 99
- Joined: Mon Sep 03, 2007 7:49 am
- Location: Stockholm, Sweden
You can only issue commands from DB2 API stage that is valid SQL and can be run from any SQL-editor. RUNSTATS in DB2 is a database command and therefore it cannot be run in db2 api stage.
Use db2 enterprise stage open and close command instead. It can issue sql and databse commands.
Use db2 enterprise stage open and close command instead. It can issue sql and databse commands.
-------------------------------------
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
It's supposed to behave like that... runstats is not SQL. It's similar to Oracle and SQL*Plus, you can execute things in SQL*Plus which will throw errors at you in the Oracle Stage.koolnitz wrote:Thanks stefanfrost1 for your response.
Is it a limitation of DB2 API stage or it is supposed to behave this way?
In theory there's no difference between theory and practice. In practice there is.