[ic] UI Combo Select Question

Jason Kohles interchange-users@lists.akopia.com
Fri Jun 8 09:25:01 2001


On Fri, Jun 08, 2001 at 08:59:36AM -0400, Chris Rapier wrote:
> I could kiss you!
> 
> I won't though as a favor to you.
> 
> The DBM v SQL thing is a valid concern and somethign I've kept meaning
> to look into...
> Okay, here is the question, if I switch from DBM to SQL will I need to
> rewrite any queries assuming that they don't explicitly specify dbm?
> 
The only real problem with DBM vs SQL queries is that SQL::Statement
understands a fairly limited subset of real SQL, so any queries that work
with DBM will certainly work with SQL, just not necessarily the other way
around.


> Mike Heins wrote:
> > 
> > Quoting Chris Rapier (rapier@psc.edu):
> > > I'm trying to use the combo select widget to allow admins to chose from
> > > 1 of several subcategories. Shoudl be pretty simple right? It looks up
> > > the column specified and returns all of the unique field values.
> > >
> > > Unfortunately, its not returning all of them. Its crapping out at 50.
> > > This is also happening under the image upload widget as well. If you
> > > have more than 50 images in that directory you'll only see the first 50.
> > > Which is kind of problematic.
> > >
> > > My feeling is that this has something to do with a default value for
> > > mv_matchlimit which is, I think, 50. So I edited Scan.pm to raise this
> > > to 75 but I still only saw 50 items. I'm banging my head against a wall
> > > here. Any information on how I can increase this limit would be really
> > > really helpful.
> > 
> > Actually, you are running into a limit of 50 -- maybe I figured if you were
> > using DBM you would not want to do that type of thing for distinct value
> > sets, or maybe I just forgot that it would affect DBM. Remember, DB searches
> > for DBM can get very slow with large numbers of records.
> > 
> > These limits don't affect SQL databases.
> > 
> > The section of code that pertains is in lib/UI/Primitive.pm, and if you added
> > an option hash that set ml => 10000 it would work. Perhaps the better place
> > to set it is in lib/Vend/Table/Common.pm, and I will probably look at that
> > eventually for 4.7.x and higher.
> > 
> > For the moment, if you apply this patch to lib/UI/Primitive.pm (for 4.7, finding
> > 4.6 equivalent is easy):
> > 
> > *** /DU/Primitive.pm    Tue May 29 10:22:33 2001
> > --- /du/Primitive.pm    Thu Jun  7 23:01:39 2001
> > ***************
> > *** 920,927 ****
> >                                 my $dbname = $record->{db} || $table;
> >                                 my $db = Vend::Data::database_exists_ref($dbname);
> >                                 last LOOK unless $db;
> > !                               my $query = "select DISTINCT $key, $fld FROM $dbname ORDER BY $fld";
> > !                               my $ary = $db->query($query);
> >                                 last LOOK unless ref($ary);
> >                                 if(! scalar @$ary) {
> >                                         push @$ary, ["=--no current values--"];
> > --- 920,934 ----
> >                                 my $dbname = $record->{db} || $table;
> >                                 my $db = Vend::Data::database_exists_ref($dbname);
> >                                 last LOOK unless $db;
> > !                               my $flds = $key eq $fld ? $key : "$key, $fld";
> > !                               my $query = "select DISTINCT $flds FROM $dbname ORDER BY $fld";
> > !                               my $ary = $db->query(
> > !                                               {
> > !                                                       query => $query,
> > !                                                       ml => $::Variable->{UI_ACCESS_KEY_LIMIT} || 500,
> > !                                                       st => 'db',
> > !                                               }
> > !                                       );
> >                                 last LOOK unless ref($ary);
> >                                 if(! scalar @$ary) {
> >                                         push @$ary, ["=--no current values--"];
> > 
> > it should help.
> > 
> > --
> > Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
> > phone +1.513.523.7621      <mheins@redhat.com>
> > 
> > I don't want to get to the end of my life and find I have just
> > lived the length of it. I want to have lived the width of it as
> > well. -- Diane Ackerman
> > _______________________________________________
> > Interchange-users mailing list
> > Interchange-users@lists.akopia.com
> > http://lists.akopia.com/mailman/listinfo/interchange-users
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 
Red Hat E-Business Solutions                    Jason Kohles
11480 Sunset Hills Road                         Senior System Architect
Reston, VA 20190                                jkohles@redhat.com