|
From: Phil R L. <prl...@Le...> - 2003-03-07 16:21:57
|
Hi,
This question is about SPOPS...
I want an object abstraction for my existing RDBMS. SPOPS seems to
offer a nice way of setting up the schema. :-)
My question is about supported usage syntax. How does one fetch records
based on *mutiple* criteria? I saw this example for fetching based on
one criterion:
1: my $publisher = My::Publisher->fetch( $pub_id );
2: my $books = $publisher->book;
3: print "Books published by $publisher->{name}:\n";
4: foreach my $book ( @{ $books } ) {
5: print " $book->{name}\n";
6: }
But I would like to select books based on multiple attribute limits...
Ex:
my $books = My::Book->fetch(
publisher => My::Publisher->fetch( name => $pub_name ),
pages => ['<' => $pages],
);
print "Books pub'd by $pub_name with < $pages pages.\n"
foreach my $book ( @{ $books } ) {
print " $book->{name}\n";
}
BIG PICTURE:
For ad hoc reporting, I ultimately want to offer a series of WWW forms that:
1. prompt user to pick 1 of the available objects
2. prompt user to choose fields (attributes) of that object
for SELECTion
3. prompt user with all the available limits (attributes)
for that object. User will set the values with which the
object population will be limited.
Assuming I can programaticly interrogate the schema such that #1-3 are
possible, I will need to generate method calls to get the result. Thus
my question above.
Comments?
Phil R Lawrence
PS - I'm not yet subscribed, please CC me any response. Thanks!
|