[comp.databases] Oracle menus?

tew@n.sp.cs.cmu.edu (Thomas Warfel) (07/22/89)

I recently inherited a job maintaining a PC/RT running ORACLE, including
SQLPLUS, SQL*FORMS, and PRO*C.  I want to write a series of menu forms
that can branch from one to the next, or EXIT back to the calling menu.

What is the easiest way to do this?  SQL*FORMS won't let me define a form
without mapping it to a table, and unless it modifies the table in some
way, I get a fatal error leaving the form.

Has anyone successfully implemented a forms-based menu system in ORACLE,
and if so, would you be willing to share sample code I could look at?

Please e-mail to tew@n.sp.cs.cmu.edu

Thanks,
 -Tom

steve.jackson@canremote.uucp (STEVE JACKSON) (07/23/89)

>What is the easiest way to do this?  SQL*FORMS won't let me define a
>form
>without mapping it to a table, and unless it modifies the table in
>some
>way, I get a fatal error leaving the form.
>
>Has anyone successfully implemented a forms-based menu system in
>ORACLE,
>and if so, would you be willing to share sample code I could look at?
You can use SQL*Forms to create menus quite simply.  A 'control' block
and a 'control' field, are blocks and fields that do not correspond to
any table or row.  In you main menu block, define the block, and leave
the table_name field empty.  At the control field, de-select database
field.  Now you can use key-triggers to control your application, 
including context sensitive help keys. 
take care
sjackson

---
 * Via ProDoor 3.0R 

papegaai@eurtrx.UUCP (SKBS) (07/24/89)

tew@n.sp.cs.cmu.edu (Thomas Warfel) writes:

>I recently inherited a job maintaining a PC/RT running ORACLE, including
>SQLPLUS, SQL*FORMS, and PRO*C.  I want to write a series of menu forms
>that can branch from one to the next, or EXIT back to the calling menu.

>What is the easiest way to do this?  SQL*FORMS won't let me define a form
>without mapping it to a table, and unless it modifies the table in some
>way, I get a fatal error leaving the form.

The answer is, yes, it is possible. There are various ways to do it, all
of which are more or less complicated. The trick I used most goes along
the following lines:

1) create a form based on a table called DUMMY. This table has only one
record and only one field and is not used for any other purpose than
this;
2) make sure the single field from the DUMMY table is invisible (page
0);
3) then create as many fields (all non-database) as you have choices to
represent;
4) write a key-trigger (pick any key) that contains a CASE statement checking
the current field, calling a different form for each field the cursor
can be in;

This works fine, as long as you make sure that all the fields are either
update protected or contain a trigger that automatically clears them of
any input as soon as the cursor leaves them. By triggering the cursor
movement keys, you can make the screen-navigation behave exactly as you
like.

I do not have access to the code right now, and it's been almost a year
since I wrote anything in SQL*Forms. If you need more information,
contact me, and I will see what I can do for you.

B.C. Papegaaij
BSO/Artificial Intelligence bv
The Netherlands