Display Item In form 6i [message #38637] |
Thu, 02 May 2002 09:11 |
Mark
Messages: 284 Registered: July 1998
|
Senior Member |
|
|
Hello I'm trying to put a display item in the course block in forms 6i.
SQL> desc faculty
Name Null? Type
----------------------------------------- -------- ----------------------------
FNUM NOT NULL VARCHAR2(3)
FNAME VARCHAR2(15)
DEPART VARCHAR2(10)
GENDER VARCHAR2(6)
SALARY NUMBER(6)
SQL> desc course
Name Null? Type
----------------------------------------- -------- ----------------------------
CNUM NOT NULL VARCHAR2(6)
CNAME VARCHAR2(15)
TIME VARCHAR2(5)
ROOM VARCHAR2(5)
FNUM VARCHAR2(3)
Faculty is the master block, and course is a detailed block and they are joined by Faculty.FNUM=course.FNUM
I want to put and display all faculty and all course filds(no problem with this, but I want to put a diplay item in the course block and display FNAME? Thanks and hope this is clear.
Mark
|
|
|
Re: Display Item In form 6i [message #38639 is a reply to message #38637] |
Thu, 02 May 2002 10:09 |
Jon
Messages: 483 Registered: May 2001
|
Senior Member |
|
|
It's been a while since I've done Forms programming, but its easy to put a display item in the block. Just add the item in the layout editor while in the context of the block. Be sure to make the DATABASE ITEM property = 'NO'. Also, if you only want to show it once (I assume the course is a multi-record block), make "Number of Items Displayed" = NO. You can set "Copy Value from Item" to get the value from the faculty block.
|
|
|
Re: Display Item In form 6i [message #38776 is a reply to message #38637] |
Tue, 14 May 2002 03:09 |
Rajen
Messages: 2 Registered: January 2002
|
Junior Member |
|
|
Hi you need to create a trigger at block level (post / pre query trigger ) and inside the trigger ad the following code :
BEGIN
SELECT faculty.NAME
INTO :course.name
FROM courses
WHERE faculty.fnum=course.fnum
EXCEPTION
when no_data_found then
msg('SYS',1....);
when too_many_rows then
msg('SYS',2....);
END;
|
|
|