In 8i u have to use dynamic sql.
In9i u may use rollup directly in pl/sql code.