Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PL/SQL and FORMS30 questions

16 views
Skip to first unread message

Paul H. Anderson

unread,
Jan 7, 1993, 4:33:39 PM1/7/93
to
Howdy,

I have several problems with sqlforms30 that are really hanging me up:

1) setting the date in a displayed, but non-enterable field.

I have a pre-record trigger that is attempting to automatically
store the date of entry into a base table field. If I convert the
date, and store it in some other enterable field (e.g. a character
comment field), etc, it shows up. (hence the trigger is working like I want).
Likewise, if I set the field to be enterable, I can have it's value
appear there (override any default value).
However, when I do the fairly obvious, which is to set a displayed,
but non-enterable date field equal to sysdate, nothing shows up.
How can I do this?

2) getting a unique sequence number into a pl/sql local variable.

I need to use a trigger to call a host program with a unique
number. To do this, I need to get the unique number into a
local pl/sql variable. I can use insert into <record> values (seq.nextval)
to put it into the record, but I don't know how to get the record
back out (since there are multiple forms users). Apparently, the
implementation context of the sequence makes it difficult for a
trigger to get the value. Any clues?

Thanks greatly for any advice!

Paul Anderson
p...@umich.edu

fgr...@hayes.com

unread,
Jan 8, 1993, 7:07:22 AM1/8/93
to
In article <1ii7jj...@terminator.rs.itd.umich.edu>, p...@citi.umich.edu (Paul H. Anderson) writes:
> Howdy,
>
> I have several problems with sqlforms30 that are really hanging me up:
>
> 1) setting the date in a displayed, but non-enterable field.
>
> I have a pre-record trigger that is attempting to automatically
> store the date of entry into a base table field. If I convert the
> date, and store it in some other enterable field (e.g. a character
> comment field), etc, it shows up. (hence the trigger is working like I want).
> Likewise, if I set the field to be enterable, I can have it's value
> appear there (override any default value).
> However, when I do the fairly obvious, which is to set a displayed,
> but non-enterable date field equal to sysdate, nothing shows up.
> How can I do this?

Try using a PRE-INSERT / PRE-UPDATE trigger (one or both, depending
on your circumstances) to set the field to SYSDATE.


>
> 2) getting a unique sequence number into a pl/sql local variable.
>
> I need to use a trigger to call a host program with a unique
> number. To do this, I need to get the unique number into a
> local pl/sql variable. I can use insert into <record> values (seq.nextval)
> to put it into the record, but I don't know how to get the record
> back out (since there are multiple forms users). Apparently, the
> implementation context of the sequence makes it difficult for a
> trigger to get the value. Any clues?

You are apparently inserting the sequence numberdirectly into the
data table. Try creating it to a field in the form and then
commiting / updating the record. In this fashion, you will still
have a copy of the number after the record is committed.

If you are moving across forms, store the sequence in a global
variable and then retrieve it a s needed.

----------------------------------------------------------------------------
| Frank Greene | ////// ////// |
| DELPHI SYSTEMS, Inc. | //// //// |
| Telephone [615] 458-6032 | //// //// ////// |
| Compuserve 74200,427 | //// //// //// |
| 324 Ootsima Way | //// //// //// |
| Loudon, TN 37774 | ////// ////// ////// |
----------------------------------------------------------------------------
| Of course, any opinions or suggestions are strictly my own |
----------------------------------------------------------------------------

David Edwards /DP

unread,
Apr 23, 1993, 5:20:58 AM4/23/93
to
In article <1ii7jj...@terminator.rs.itd.umich.edu> p...@citi.umich.edu (Paul H. Anderson) writes:
+1) setting the date in a displayed, but non-enterable field.
+
+ I have a pre-record trigger that is attempting to automatically
+ store the date of entry into a base table field. If I convert the
+ date, and store it in some other enterable field (e.g. a character
+ comment field), etc, it shows up. (hence the trigger is working like I want).
+ Likewise, if I set the field to be enterable, I can have it's value
+ appear there (override any default value).
+ However, when I do the fairly obvious, which is to set a displayed,
+ but non-enterable date field equal to sysdate, nothing shows up.
+ How can I do this?
+
+
+Paul Anderson
+p...@umich.edu

Set the default value to $$DATE$$ for a date field. The strange thing
is one needs a form mask if you do this. I use YYMMDD although I
suppose any valid date format could be used. (The default mask for
dates
is not used).

This way you avoid triggers and keep the form simple.

David Edwards
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The surface of the strange, forbidden planet was roughly textured and
green, much like cottage cheese gets way after the date on the lid
says it is all right to buy it.--Scott Jones

Stephen Schow

unread,
Apr 23, 1993, 1:56:43 PM4/23/93
to
Although it does involve triggers, I prefer to use the on-database-record
trigger to fill any and all fields with auto-generated data such as
timestamps and sequence numbers.

The on-database-record fires whenever a record is first marked for update
or insert( you can test for which within the trigger). Then inside that
trigger you just assign the values to fields.

I do it this way because I don't want any default values assigned to fields
until the user enters data into at least one of the enterable fields. If
I use the default value thing, then those values are immediatly put into the
fields, and the record is already marked for insert or update.
--
------------------------------------------------------------------
Steve Schow | But you don't have to use the claw, if you
s...@netcom.com | pick the pear with the big paw paw......
(415) 354-4908 | Have I given you a clue......?
| - Baloo the Bear
------------------------------------------------------------------

fgr...@hayes.com

unread,
Apr 26, 1993, 8:54:04 AM4/26/93
to


You do have the ECHO INPUT attribute selected don't you? If you have only
selected DISPLAYED, then any changes, such as in you pre-record trigger, will
not display.

----------------------------------------------------------------------------
| Frank Greene | _/_/_/ _/_/_/ |
| DELPHI SYSTEMS, Inc. | _/_/ _/_/ |
| Telephone [615] 458-6032 | _/_/ _/_/ _/_/_/ |
| Compuserve 74200,427 | _/_/ _/_/ _/_/ |
| 324 Ootsima Way | _/_/ _/_/ _/_/ |
| Loudon, TN 37774 | _/_/_/ _/_/_/ _/_/_/ |

0 new messages