On 6/14/06 6:42 AM, Lucian Dragus wrote:
> In Postgresql I'm having a stored procedure, which is returning agregate data,
> based on passed parameters. In front on that is a Rose::DB::Object subclass
> and at each invocation of a 'select' method I'm changing the table name to
> include the parameters, like:
> 
> $meta->table("stored_proc('a', NULL, 12)");
> 
> In RDBO-0.73 / RDB-0.70 all is working fine, but with RDBO-0.731 / RDB-0.71
> Postgresql is complaining because table name is quoted in the generated sql

I'm surprised that ever worked since it's not strictly supported.  The
suggested alternative is to make a VIEW on your stored_proc() and then point
RDBO at that view.

> What is the normal behavior for quoting the table name: pre- RDBO-0.731 /
> RDB-0.71 or that of actual versions ? Or the behavior can be controlled by a
> switch ?

RDBO is supposed to quote table names that look like they need quoting
(e.g.,have embedded spaces or quote characters), so the 0.731 behavior is
"correct."  That said, I suppose I could add an option to control this
behavior for those that want to live dangerously.  But I still suggest using
a view.

> Also, are other corelated effects if I'm changing the table name
> after initialization ?

Probably.  Don't do that :)

> What are the possibilities / recommended approaches of using RDBO/RDB  for
> reporting purposes ? I want to use views, stored procedures and dimensional
> modeling in db (star schemas). These implies read-only queries (only
> selects), absence of primary keys, agregate functions (using 'group by'
> and 'having' clauses), huge number of columns or columns defined dinamically.

Methods like this are intended to go in Manager classes.  But the built-in
Manager methods deal only with tables that have primary keys, and queries
that return unique row from those tables in the form of RDBO objects.  It's
possible to roll your own Manager methods that run custom SQL and return
arbitrary data rather than row objects, and the QueryBuilder might be able
to help you automate the process somewhat, but there's currently no
get_results() equivalent to get_objects().  It's on the list...

-John




_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to