> I saw but I need it at runtime (in a SP with "select into") and my SP can't execute statistics, any idea ?- Hide quoted text -
>
> - Show quoted text -
I would try creating the select count(*)-statement by joining
syscat.datapartitions on syscat.datapartitionexpression using - based
on your partition key - a combination of CASE statements, LISTAGG, row
value constructors , ... and execute it using EXECUTE IMMEDIATE. What
you can use depends on your DB2 version (RVC is V10 only). How
complicated that becomes depends mainly on your partition key, I can't
estimate that from here nor do I know for sure if it would be
possible :-)
--
Frederik Engelen