update table data via oracle forms 10g [message #515010] |
Thu, 07 July 2011 13:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/73da323c315e8b6678fff9aac9cc8cce?s=64&d=mm&r=g) |
msdtjw
Messages: 25 Registered: March 2011
|
Junior Member |
|
|
I am trying to develope a form consisting of a keyblock and a single data block.
The problem is that the driving table is not the table that needs to be updated.
user wants the following layout:student Advisor
ID# name degree major Concentration ID# name
The driving table (TABLE A) will supply the first 5 fields. The advisor ID comes from (TABLE B).
The user needs to update the advisor ID# field associated with the student ID# field. The form is to be tabular listing all students.
I've seen some info on using procedures to insert, delete, update, query and lock tables, but i'm just not sure if that's what is needed.
Any help is appreciated.
Thanks
[EDITED by LF: applied [pre] tags to preserve formatting]
[Updated on: Fri, 08 July 2011 01:16] by Moderator Report message to a moderator
|
|
|
Re: update table data via oracle forms 10g [message #515081 is a reply to message #515010] |
Fri, 08 July 2011 01:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
How do these tables look like? How are they related? A student can have only one advisor, I suppose? If so, these tables *should* look like this:CREATE TABLE advisor
(
a_id NUMBER PRIMARY KEY,
name VARCHAR2 (20)
);
CREATE TABLE student
(
s_id NUMBER PRIMARY KEY,
name VARCHAR2 (20),
degree VARCHAR2 (20),
major VARCHAR2 (20),
concentration VARCHAR2 (20),
a_id NUMBER CONSTRAINT fk_st_ad REFERENCES advisor (a_id)
);
Which means: the STUDENT table already contains the advisor ID (A_ID column) so - you have to fetch advisor's name into the block (that would be a display item, populated in WHEN-VALIDATE-ITEM trigger on the A_ID column (during insert/update) and POST-QUERY block trigger (during select)).
On the other hand, if I was wrong, please, answer questions posted at the beginning of this message.
|
|
|
|
|
|
|
|