From: sharad@saathi.ncst.ernet.in (Sharad Popli)
Subject: SQL*Forms30 ... "sequences" & "update" problems :(
Keywords: sqlforms, sequences, update
Organization: National Centre for Software Technology, Bombay, India.
Date: Tue, 29 Sep 1992 11:09:58 GMT

Hi...

I'm working on a project using SQL*Forms30 and I have a couple
of problems.

Working enviornment
-------------------

I'm presently  working with software specs. as shown below (development
on).....

                    Development on                To be ported to
                    --------------                ---------------

* Oracle version :   6.0.27                        6.0.33
* SQL*Plus       :   3.0.6.5.1                     3.0.9.1.2
* SQL*Forms30    :   3.0.11.0.0 (Beta)             3.0.16.4.2
* PL/SQL         :   01.00.28.01.00 (Beta)         01.0.33.3.1


Problem 1 
---------
I've designed a form - the relevant details of which are shown below :
********************************************************************************

+----------------+------------------------------------------+------------------+
|Date: 29-SEP-92 |               H  e  a  d  e  r           |Role: _____       |
|                |                                          |Name: __________  |
+----------------+------------------------------------------+------------------+
| Indent No. 370_____     Catg. N   Type L    Class __ ___     Sr No 99999999  |
|                                                                              |
|          Remaining portion not required.....

********************************************************************************

In the fields  "Indent No." & "Sr. No" (shown above) I want the system 
to generate automatic and unique numbers.
(There could be a whole lot of people accessing this form
simultaneously)

For the "Indent No." field I have a created a sequence & in it's 
default value I have the statement :

        DEFAULT = :sequence.ind_no.nextval

where the sequence name is "ind_no"
This works fine.... :)

The problem is in the "Sr. No." field....While the indent no. is global
accross the system - the sr.no must be decided depending upon which
division the employee (who is accessing the form) belongs to.
The employees divn. will be known only after he "logs in" to this
oracle system.(via another form)

Assume there are 20 divns. I thought of creating 20 different sequences 
& then after getting the employee's divn. no I attempted to fill in the
"Sr. no." field using a statement as :

	 select sequence_name.nextval into :sr_no

where - sequence_name will be the seq. corresponding to the appropriate
	division & sr_no is the field in the form into which the value
	has to be entered.

BUT this does not work - WHY NOT ??
Is there any other solution for my problem ?


Problem 2
---------
I have a form which has "dual" as its base table. After the user
enters some values into  the fields (and the required checks are 
carried out) - I am using an "update" statement in the "key-nxtfld"
trigger of the last field. This update statement updates values in 
another table (the values are taken from the contents of this form's
fields)
Before I exit the form I've tried various statements like:
commit,
commit_form,
clear_form(do_commit),
exit_form(do_commit), etc.

OBSERVATIONS (& confusion) :
------------
On the "development enviornment" - the values GET updated.
BUT on the other "production" enviornment the values do NOT get
updated. (Although the form exits just fine - and does not crib
or give any errors).

Where is the problem ??


Let me thank in advance all those who take the trouble to consider
my problems.

Incidentally my "newsfeed" is not reliable at the moment and so I 
would prefer a reply via email.

Sharad :)

email : sharad@saathi.ncst.ernet.in
-----------------------------------