Hi "edgarv",
As an example of GROUP BY, if you have a table employee_skills (empno, fname, lastname, skill_code, skill_date) then you might want to count the skills for each employee and show their names [even though empno would be a good enough "GROUP BY" column:
SELECT empno, fname...
Hi "RDharmar",
I think you should add another "output" parameter to the call list for the s-p and place the string you are curious about into that s-p parameter variable. When you return from the CALL statement, examine that parameter.
Larry Kintisch
IBM Contractor Instructor for DB2, SQl...
Hi "TitleistDBA",
I think you want to do this:
UPDATE MVXCJDTDVL.MITBAL AS B
SET MBWHSL = 'SPECIAL'
WHERE EXISTS
( SELECT * FROM MVXCJDTDVL.MITMAS AS M
WHERE M.MMITTY IN ( 'wM1','WM2' ,'3LY','3L1') --careful l.c
AND M.MMCONO = B.MBCONO
AND M.MMITNO = B.MBITNO
);
I...
Hi Lucas,
No you can't "reset" statistics.
You can "UPDATE" statistics such as:
UPDATE SYSSTAT.TABLES
SET CARD = -1
NPAGES = -1
FPAGES = -1
OVERFLOW = -1
WHERE TABSCHEMA = 'xxx'
AND TABNAME = 'yyy'
If you have DB2 for Win-Unix installed on a PC, go to...
Lukas,
The development of the DB2 optimizers [z/Os, Win-Unix, AS/400] has totaled thousands of person-years. They are cost based, so part of the "smarts" of the optimizer is estimating percentages of the table rows qualifying so that it can estimate how much "work" it will have to do with...
Lukas,
Here's my guess. Before the RUNSTATS DB2 probably saw "-1" values in the catalog statistics columns and assumed a smallish table and would do a few table scans. You were using short rows so roughly 250 rows per page meant you had about 4000 pages each. A modern server could probably...
Hi All,
Ties is partially correct. You do need to do a RUNSTATS for each table. But with DB2 you also need to do a RUNSTATS for each index. Try that and run your test again and please report back to us the results.
Then I'd like you to try another test or two.
Drop the index on table R...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.