Thanks for your advice. I am making a separate module to handle the output. About the zeroes and NULLs, I'll fix it. They are actually interchangeable for this purpose only, but it's better to make a clear distinction.
By the time it's ready for CPAN, the name will probably change into DBIx::SQLCrosstab. Giuseppe On Wed, 2003-09-10 at 01:45, Tim Bunce wrote: > On Wed, Sep 10, 2003 at 12:15:47AM +0200, Perl Authors Upload Server wrote: > > > > The following module was proposed for inclusion in the Module List: > > > > modid: DBIx::Xtab > > DSLIP: bdpOp > > description: creates server-side multi-level DB crosstabs > > userid: GMAX (Giuseppe Maxia) > > chapterid: 7 (Database_Interfaces) > > communities: > > > > similar: > > Data::Pivot does one level only - none does server-side and > > multi-level xtab > > > > rationale: > > > > DBIx::Xtab creates server-side multi-level cross tabulation > > reports. Given some parameters, it creates the appropriate query to > > get the crosstab, fetches the records and returns the output in raw > > format, HTML or XML. Unlike spreadsheet pivot tables, all the > > calculation is done on the server side, and in addition the query is > > not limited to one table only. I am writing the documentation and > > creating the installation tests In the meantime, you can see the > > code, some docs and a few colorful examples at this link: > > http://gmax.oltrelinux.com/xtab/xtab.html Any comments would be > > welcome. > > Cool. > > Seems like nulls and zeros are not distinguished well. For example: > remove_zeroes > Remove from the record set all the columns where all > values are zero or NULL. > Nulls and zeros are not always so interchangable. And I don't see any > examples in the docs where missing data appears as blank cells but > zeros appear as zeros. > > Also, I think the formating of the output table should be delegated > to a separate module. There are several on CPAN already. If none > do the 'straddled' rows and columns you feature then perhaps you > could extend one of them or extract your formatting code into a new > modules. > > > I am not sure about the DBIx:: namespace. The rationale behind my > > choice is that the module is - potentially - database independent, > > so it can really be a DBI extension. > > It generates and executes queries via the DBI and is fairly abstract > in nature (not application specific) so DBIx::* seems fine to me. > > Would be good to indicate the server-side nature of the module though. > So perhaps something like DBIx::ServerXtab or DBIx::SQLCrossTab. > > Tim. >