Forms 4.5 - Block based on a View

From: Simon <simonc_at_oakton.com.au>
Date: 1996/05/05
Message-ID: <4mhg9s$avp_at_news.mel.aone.net.au>#1/1


G'day all,

I have 2 tables:

table_a (table_a_id number, desc_a varchar2(10), table_b_id number ) table_b (table_b_id number, desc_b varchar2(10) )

Originally I had a simple block based on table_a, with a post_query trigger to look up table_b.desc_b based on table_a.table_b_id.
i.e. A block based on table_a with columns for:   table_a_id, desc_a, desc_b

The *User* now wants to have the block ordered by desc_b.

Does anybody have ideas on a "nice" way to do this (I am sure someone has had to do it before!)?

What I had in mind was to create a view: CREATE VIEW TABLE_A_VIEW AS
  SELECT TABLE_A_ID, DESC_A, DESC_B
  FROM TABLE_A, TABLE_B
  WHERE TABLE_A.TABLE_B_ID = TABLE_B.TABLE_B_ID; & then base my block on table_a_view. Of course this block wouldn't be updateable, so I would have to replace the update, insert, delete functionality manually by using the ON-INSERT, ON-UPDATE, ON-DELETE triggers.

Then there is the problem of locking the record when the user trys to change it. Forms 4.5 doco says to use the ON-LOCK trigger to "lock underlying tables for non-updateable views" - but it doesn't say how!!

My question is this - if what I have outlined above is the appropriate course of action (if not - what is a better one!), how to I simulate the locking & then updating of records at appropriate times???

Any suggestions/comments etc appreciated.

Thanks.

  • Simon.
Received on Sun May 05 1996 - 00:00:00 CEST

Original text of this message