how to show multiple records in a grid according to condition [message #266473] |
Tue, 11 September 2007 00:08 |
sams
Messages: 100 Registered: August 2007
|
Senior Member |
|
|
i m making inbox.when a person logins ,he should see only those messages that are sent to him.
i m writing this code.problem is that it show only one message.(for example four messages sent to that person who logins but when he clicks inbox only one is displayed to him)
i have wriiten it on form's "new_form_instance" trigger.it compiles sucessfully and shows only one message at a time.
i have made grid of display boxes to show messages.
declare
cursor c is
select m.msg_no,m.teacher_id,m.msg_subject,m.msg_date
from mesage m,teacher t
where m.receiver_id= (select t.teacher_id
from teacher t
where t.login_id = :global.log)
and t.teacher_id = m.teacher_id;
begin
open c;
loop
/*fetching value into display boxes of the block 'mesage'
,name of display boxes are'msg_no','teacher_id','msg_subject','msg_date'*/
fetch c into :mesage.msg_no, :mesage.teacher_id,:mesage.msg_subject,:mesage.msg_date;
exit when c%notfound;
end loop;
close c;
end;
global.log is global variable that stores login id of each person that logs in.
plz tell me how to show all messages in grid
i m sending the pic of interface.(inbox)
reply
thnks
-
Attachment: pic.bmp
(Size: 1.37MB, Downloaded 719 times)
[Updated on: Tue, 11 September 2007 00:11] Report message to a moderator
|
|
|
|
|
Re: how to show multiple records in a grid according to condition [message #266579 is a reply to message #266574] |
Tue, 11 September 2007 03:05 |
sams
Messages: 100 Registered: August 2007
|
Senior Member |
|
|
thnks but where to add this:
next_record;
plz add this statment in my given code.
i have added but still only one message is seen.
declare
cursor c is
select m.msg_no,m.teacher_id,m.msg_subject,m.msg_date
from mesage m,teacher t
where m.receiver_id= (select t.teacher_id
from teacher t
where t.login_id = :global.log)
and t.teacher_id = m.teacher_id;
begin
open c;
loop
fetch c into :mesage.msg_no, :mesage.teacher_id,:mesage.msg_subject,:mesage.msg_date;
next_record;
exit when c%notfound;
end loop;
close c;
end;
thnks 4 ur reply
|
|
|
|
|
|
|