Re: [gnome-db] input values in SQL view
- From: Rodrigo Moya <rodrigo gnome-db org>
- To: Vivien Malerba <malerba gnome-db org>
- Cc: Fernando Martins <fmartins hetnet nl>, GDA <gnome-db-list gnome org>
- Subject: Re: [gnome-db] input values in SQL view
- Date: 19 Jan 2003 23:39:01 +0100
On Sun, 2003-01-19 at 21:20, Vivien Malerba wrote:
> On Sun, Jan 19, 2003 at 02:47:42AM +0100, Fernando Martins wrote:
> >
> > Rodrigo wrote:
> > > it doesn't understand data types. It just replaces :whatever with the
> > > string you enter in the dialog, nothing else. So, you have to either
> > > use:
> > >
> > > select * from customers where name = ':field1'
> > >
> > > or enter 'value' on the dialog.
> > >
> >
> > I've been using Zope and it has a nice way to deal with parameters and data
> > types:
> >
> > select * from customers where name = <dtml-sqlvar field1 type=string>
> >
> > Replace string by int, float, nb, etc., (nb means a non-blank string).
> >
> > Zope includes another parameter, "Optional", to indicate the parameter might
> > be absent. Not sure what's the point of it, though.
> >
> > Anyway, with this approach, one could think about other parameters, like
> > "default=[default value]" to support default values, or "fmt='%3d'" to
> > support formatting a value, or a more generic, but harder to implement,
> > "eval=calculate(field1)", to apply a function to the parameter before
> > rendering it in the query statement.
> >
>
> Yes, good idea. This way we also could use the plugins from mergeant
> which explain how to enter data depending on the data type (so no more
> worry about the 'value' instead of simply value).
>
yes, sounds good. I'll do it that way. Is there a widget(s) already for
that?
cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]