in reply to Re: Weird DBI behaviour
in thread Weird DBI behaviour
If my verbiage doesn't clarify, perhaps these succinct examples will help.
update You might want to check out the latest DBI since the docs you cite have been rewritten and are perhaps clearer (if not, submit a doc patch). One thing that the newer docs make clear is that the attributes hash in select_all_arrayref($stmt, \%attr, @vals) is a very powerful feature and that supplying a slice is only one of the things you can do with it. If you supply a max value in the attributes hash, for example, your result set will be limited to that number of rows (a perl version of LIMIT for those databases that don't support it.The basic idea is that the name of the method "selectall_arrayref" specifies what kind of a strucure the results will be returned in and the attributes hash specifies the characteristics of that structure. Yes, I do see how that can be a bit confusing, but it's also a very powerful concept. Upcoming versions of DBI will use these attribute hashes to methods even more extensively allowing you to specify both the return structure, attributes of that structure, and attributes of the method of fetching.
update 2 Thanks for bringing this up, it's forced me to think :-). Here's a generic description of a DBI method call that applies to selectall_arrayref and most other DBI methods:$handle->what_perl_structure_to_fetch_results_into( $what_results_to_fetch, \%characteristics_of_the_fetch_and_of_the_fetch_into, @values_to_further_specify_what_to_fetch );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Weird DBI behaviour
by punkish (Priest) on Aug 19, 2005 at 16:38 UTC | |
by jZed (Prior) on Aug 19, 2005 at 16:47 UTC |