473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Calling Runstats from VBA

I am attempting to call RUNSTATS_KEY from VBA code and everything looks
coorect to me, however when I run it, it errors out. The code snippet
is below...

Set cmd = New ADODB.Command
cmd.ActiveConnection = conDatabase
cmd.CommandText = "spinload.runstats_key"
cmd.CommandType = adCmdStoredProc
cmd.CommandTimeout = 3600
cmd.Parameters.Append _
cmd.CreateParameter(, adVarChar, adParamInput, 255,
"SESSION.DATA_CUBE_EXTRACT")
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs = cmd.Execute

Does anyone have any ideas what might be causing this problem? I can
run the CALL command to runstats myself when at a command line, or from
the control centerl, but from VBA it just doesn't want to work. If
anyone has any alternate ideas for collecting the stats let me know,
but obviously Shell won't work since this is a session table, thus
belonging to the login from excel.

Jun 1 '06 #1
3 1933

"DW Marker" <dw******@yahoo.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I am attempting to call RUNSTATS_KEY from VBA code and everything looks
coorect to me, however when I run it, it errors out. The code snippet
is below...

Set cmd = New ADODB.Command
cmd.ActiveConnection = conDatabase
cmd.CommandText = "spinload.runstats_key"
cmd.CommandType = adCmdStoredProc
cmd.CommandTimeout = 3600
cmd.Parameters.Append _
cmd.CreateParameter(, adVarChar, adParamInput, 255,
"SESSION.DATA_CUBE_EXTRACT")
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs = cmd.Execute

Does anyone have any ideas what might be causing this problem? I can
run the CALL command to runstats myself when at a command line, or from
the control centerl, but from VBA it just doesn't want to work. If
anyone has any alternate ideas for collecting the stats let me know,
but obviously Shell won't work since this is a session table, thus
belonging to the login from excel.


I've never tried to access DB2 from VBA so I can't suggest a solution but I
think others would be better able to help if you indicated what error you
are getting and where the error originates (VBA? DB2? etc.).

--
Rhino
Jun 1 '06 #2
The error comes from VBA, and it really isn't all that descriptive as
it is a generic error message from calling the sotroed proc. Basically
at this point I am on a quest to find working code for doing a runstats
from VBA/VB code.

Rhino wrote:
"DW Marker" <dw******@yahoo.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I am attempting to call RUNSTATS_KEY from VBA code and everything looks
coorect to me, however when I run it, it errors out. The code snippet
is below...

Set cmd = New ADODB.Command
cmd.ActiveConnection = conDatabase
cmd.CommandText = "spinload.runstats_key"
cmd.CommandType = adCmdStoredProc
cmd.CommandTimeout = 3600
cmd.Parameters.Append _
cmd.CreateParameter(, adVarChar, adParamInput, 255,
"SESSION.DATA_CUBE_EXTRACT")
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs = cmd.Execute

Does anyone have any ideas what might be causing this problem? I can
run the CALL command to runstats myself when at a command line, or from
the control centerl, but from VBA it just doesn't want to work. If
anyone has any alternate ideas for collecting the stats let me know,
but obviously Shell won't work since this is a session table, thus
belonging to the login from excel.


I've never tried to access DB2 from VBA so I can't suggest a solution but I
think others would be better able to help if you indicated what error you
are getting and where the error originates (VBA? DB2? etc.).

--
Rhino


Jun 1 '06 #3
DW Marker wrote:
The error comes from VBA, and it really isn't all that descriptive as
it is a generic error message from calling the sotroed proc. Basically
at this point I am on a quest to find working code for doing a runstats
from VBA/VB code.

Try to call the ADMIN_CMD() procedure. Should work in V8.2.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jan Arickx | last post by:
My situation is as follows. I have several big SQL queries in a data warehouse using 1 big fact tables and 10 dimension tables. The queries join all of them together but the optimizer doesn't care...
7
by: Todd McNeill | last post by:
Hi- Something was just pointed out to me this morning. According to the V8 Command Reference, the RUNSTATS command no longer uses the SHRLEVEL CHANGE/REFERENCE clauses, and it looks to be...
3
by: Gilda | last post by:
Does anyone know what entity (utility?) checks if statistics collections are required, if the Automatic RUNSTATS is enabled, in version 8.2? How often are these checks done? Thanks.
1
by: raqfg | last post by:
Hi. I am trying to test out the automatic maintanance with notification feature of DB2 v8.2. I have enabled the auto maint with notification. The problem I am facing is that I only get email...
5
by: Jari Korkiakoski | last post by:
Hello, What kind of difference does it make to update statistics via 'REORGCHK UPDATE STATISTICS ON TABLE ALL' or by running directly 'runstats on table xxx.yyy with distribution and detailed...
4
by: kenfar | last post by:
I've got a large table on db2 8.2.1 that I rarely perform runstats on. It has about 600 million rows organized in a single MDC time dimension on a non-dpf warehouse. Anyhow, we recently ran...
4
by: db2udb | last post by:
Hi, I have just taken over as the DBA for a database that has not had any reorgs/runstats run against it for the last three years. As a first step, I have just run reorg/runstats against the system...
3
by: Norm | last post by:
If RUNSTATS is called directly, we can specify UTIL_IMPACT_PRIORITY to limit CPU consumption. For automatic runstats, there is no place to specify this paramater. Will it use the DBM value of...
1
by: satish mullapudi | last post by:
Hi Am using DB2 UDB ESE on AIX platform. I used to take a full/ incremental online backup regularly. This process used to go on since years. But recently, whenever am trying to take the same, am...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.