Display data in Master-Detail block structure [message #455488] |
Tue, 11 May 2010 18:34 |
coolguy01
Messages: 64 Registered: August 2006
|
Member |
|
|
Hi,
I have a master - details block relation where I have to display all the records in the details block based on the selection criteria's made in the master block. Earlier we didn't have any selection criteria and hence used to do a execute_query behind the detail block to just retrieve all the records. But now the master block contains fields where I can input the selection criteria and once I hit the find button it will retrieve the records based on those criteria and display in the detail block. Please suggest how I can approach this issue.
Thanks and Regards
|
|
|
Re: Display data in Master-Detail block structure [message #455495 is a reply to message #455488] |
Tue, 11 May 2010 20:34 |
meena.g
Messages: 14 Registered: February 2010 Location: Hyderabad (A.P)
|
Junior Member |
|
|
Hi Friend,
Need to write procedure with in mode parameter in program units then u need to call that procedure in find button.u need to write code like this for example
procedure p1 is(p_id number,p_name varchar2) is
cursor c1 is select * from table_name where emp_id =p_id and emp_name=p_name;
begin
go_block(detail_block);
clear_block(no_validate);
for i in c1 loop;
:detail_block.job_id := :i.job_id;
:detail_block.salary := :i.salary;
next_record;
end loop;
exception
when others then
message(sqlerrm);
end;
and u need to call this procedure name in find button like this
p1(:master_block.emp_id,:master_block.emp_name);
try this code. it will work.
|
|
|
Re: Display data in Master-Detail block structure [message #455520 is a reply to message #455495] |
Wed, 12 May 2010 00:58 |
coolguy01
Messages: 64 Registered: August 2006
|
Member |
|
|
HI meena
Thanks for the reply, I tried the similar thing u suggested and wrote the similar procedure
Procedure Find_Employee(p_empno IN varchar2,p_lname IN varchar2,p_fname IN varchar2,p_rank IN varchar2) is
cursor c1 is SELECT * table_1
WHERE emp_no LIKE NVL(p_empno,'%')
AND lname LIKE NVL(p_lname,'%')
AND fname LIKE NVL(p_fname,'%')
AND rank LIKE NVL(p_rank,'%');
begin
go_block('Personnel_CMU');
clear_block(no_validate);
for i in c1 loop
:Personnel_CMU.EMP_NO_COPY := i.emp_no;
:Personnel_CMU.EMP_LNAME_COPY := i.lname;
:Personnel_CMU.EMP_FNAME_COPY := i.fname;
:Personnel_CMU.RANK_COPY := i.rank;
:Personnel_CMU.SUPERVISOR_COPY := i.supervisor;
:Personnel_CMU.INACTIVE_DATE_COPY := i.inactive_date;
next_record;
end loop;
exception
when others then
message(sqlerrm);
END;
Now in the find button i call this procedure and i see the control flows into the procedure and errors at the point where the cursor i loop starts. I get the following error
FRM-92101:There was a failure in the Forms Server during startup. This could happen due to invalid configuration. Please look into the web-server log file for details.
and the form is getting closed. Is there something wrong that I am doing here?
|
|
|
|
|
Re: Display data in Master-Detail block structure [message #455766 is a reply to message #455520] |
Wed, 12 May 2010 21:34 |
meena.g
Messages: 14 Registered: February 2010 Location: Hyderabad (A.P)
|
Junior Member |
|
|
Hi Friend,
please find the attachment.
I created 2 duplicate tables.
SQL> create table a(emp_id varchar2(10),name varchar2(10),salary number(10,2),dep_id number(10,2));
Table created.
SQL> create table a1(dep_id number(10,2),dep_name varchar2(10),location varchar2(10));
Table created.
SQL> insert into a1 values(10,'asd','p001');
1 row created.
SQL> insert into a1 values(20,'asxc','p002');
1 row created.
SQL> insert into a1 values(30,'cvfgrt','p003');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into a values(100,'sdge',1000,10);
1 row created.
SQL> insert into a values(200,'hgtry',2000,10);
1 row created.
SQL> insert into a values(300,'hgtry',2000,10);
1 row created.
SQL> insert into a values(400,'hgtry',2000,20);
1 row created.
SQL> insert into a values(500,'hgtry',2000,20);
1 row created.
SQL> insert into a values(600,'hyu',200,20);
1 row created.
SQL> insert into a values(70,'hyu',24500,30);
1 row created.
SQL> insert into a values(800,'hyu',2400,30);
1 row created.
SQL> insert into a values(900,'hygthy',2000,30);
1 row created.
SQL> commit;
Commit complete.
|
|
|
|
|
|