Is it possible to create a table of views in oracle -
it might stupid question, oracle allows create table of different objects, thought maybe possible create table of views.
i need generate many, many views (which pivoting table). each view have different column names. not want pollute namespace hundreds or thousands of views named schema.xls_import_id_1234_sheet_0.
is possible create table of views? , query them
select * table( select a_view xls_sheet_views xls_id = 1234 , sheet_no = 0) or maybe way store query varchar2 type, , method execute automaticly?
no, cannot create table of views.
depending on precise business problem trying solve, potentially implement logic in pipelined table functions in package rather having thousands of views. if have many views because creating separate object every combination of attributes might pivot by, may make sense use pipelined table function accepts parameters rather having hundreds of views. or might make sense have few procedures in package return sys_refcursor.
in general, if want use pipelined table function, want know structure of result. can tricky, though, making use of polymorphism in oracle object types. can declare single object type, derive number of subtypes , return instances of subtypes pipelined table function defined on parent type. adrian billington has excellent example of sort of flexible pipelined table function. can crazier, though, data cartridge framework , develop pipelined table function returns arbitrarily structured result. now, because can this, wouldn't advocate doing without lot of careful consideration. need have level of dynamic code common pivoting data make me suspect need take step , @ architecture of system.
Comments
Post a Comment