Re: WebDB opinions ?

From: Mark Hills <m.hills_at_exec.com.au>
Date: Sat, 11 Mar 2000 10:21:13 +1000
Message-ID: <38c99130_2_at_news.ausmail.com>


You can use functions to return values for your defaults.

I do this to populate identifier fields from sequences and also for dates.

In the "Default" field on the definition page for the field in the form builder you prefix your function call with a # as in

#schema_name.function_name
or
#schema_name.package_name.function_name

The value then appears as the default value when the form is displayed.

I found this tip on p42 in the comptask.pdf file that came with the download of webdb22 from technet. The section is reproduced below:

Hope this helps,
Mark Hills.



Using functions as default values for components You can use functions to generate default values in the entry fields for forms and component parameter
entry forms. You can specify these on any page of a component build wizard that contains an option for
specifying a default value in the finished form or parameter entry form. For example, you can specify a default on the Column Formatting and Validation page of the Forms (from
Tables) component build wizard. In the Display & Validation: Default Value field on this page, you
could type #owner.package-name.nextval for the EMPNO column of the SCOTT.EMP table
where:
· # is a required character that you must type before specifying a function in an entry field on a
component build wizard page.
· owner is the schema that owns the function. You must always prefix all user-defined functions with
the owning schema. If you don't own the function, make sure you have privileges to execute it from
its owner.
· package-name is the package containing the function. · nextval is the name of a user-defined function. The name.nextval function could display the next employee number from the EMPNO column each time
the form is displayed.
You could specify a default value in a report's parameter entry form using the Column Conditions page of
the Report Build wizard. On this page, specify
· DEPTNO as the Column for a report based on SCOTT.EMP
· = as the Condition
· #owner.get_default_dept as the Value

The report's parameter entry form could display an entry field with a default value that matches the next
department from the EMPNO column each time it displays.

Jon C Szlapka <p1110c_at_email.mot.com> wrote in message news:38C98546.1DEAD81D_at_email.mot.com...
> I kludged in the current date by creating a LOV. Its select statement gets
> SYSDATE(). Then the LOV goes on the form as a combo box that doesn't show
a null
> option. It's ugly, but it works. You could probably do the same thing with
the
> user.

>

> "H. John C. Hopkins" wrote:
>

> > Hi.
> >
> > You mean other than using before-insert triggers or default column
values?
> >
> > I'm pretty certain you can set default values form fields as well,
although
> > I haven't tried using functions for default values (they may have to be
> > literals).
> >
> > -John
> >
> > H. John C. Hopkins
> > Gainesville, FL
> >
> > "Adam Lipscombe" <alipscombe_at_ingenta.com> wrote in message
> > news:Fr5Lnn.Gxy_at_bath.ac.uk...
> > > Folks,
> > >
> > >
> > > I am interested in hearing opinions on WebDB....
> > >
> > > I have been using v2.1 to produce some simple reports and forms to
provide
> > > administrator functionality on an existing database. Simple things
like
> > > adding, modifying and deleting users etc.
> > >
> > > WebDB does not seem to have anywhere near enough functionality.....
> > > For example it seems impossible when doing a form "insert" to populate
> > > columns in a table with programmatically set (i.e. no user
interaction)
> > > values such as the current time and user name.
> > >
> > > I would be grateful if anyone who has successfully used this tool to
> > produce
> > > forms that create rows with some user enetered data and some
> > auto-generated
> > > data could share their experiences...
> > > Any good tutorials or learning resources?
> > >
> > >
> > > Thanks - Adam
> > >
> >
> --------------------------------------------------------------------------
> > -
> > > Adam Lipscombe Tel: (+44) 1225 323846
> > > Ingenta Ltd email:alipscombe_at_ingenta.com
> > > BUCS Building
> > > University of Bath
> > > Bath BA2 7AY
> > > U.K.
> >
> --------------------------------------------------------------------------
> > -
> > >
> > >
> Received on Sat Mar 11 2000 - 01:21:13 CET

Original text of this message