displaying the details of a particular employee [message #168562] |
Thu, 20 April 2006 23:58 |
jagannadh_99
Messages: 4 Registered: March 2006
|
Junior Member |
|
|
hi,
i am new to this field and learning oracle right now. i have tried my best but i could not get it. so any one kindly help me
i have created a push button and when i entered the empno and pressed the button it should display the employee information of that paticular empno
if i enter the last empno it is displaying the last record other than the last empno it is dispalying as invalid empno
i have written the code as follows.DECLARE
v_empno employee.empno%type;
cursor emp_cursor is select empno,ename,deptno,sal,comm from employee;
emp_record emp_cursor%rowtype;
BEGIN
open emp_cursor;
loop
fetch emp_cursor into emp_record ;
exit when emp_cursor%notfound;
end loop;
message('enter empno');
go_block('employee');
v_empno:=:employee.empno;
for i in 1..emp_cursor%rowcount
loop
if(emp_record.empno=v_empno) then
go_block('employee');
:employee.empno:=emp_record.empno;
:employee.ename:=emp_record.ename;
:employee.deptno:=emp_record.deptno;
:employee.sal:=emp_record.sal;
:employee.comm:=emp_record.comm;
else
message('invalid empno');
end if;
end loop;
close emp_cursor;
END;
[Updated on: Fri, 21 April 2006 00:22] by Moderator Report message to a moderator
|
|
|
|
|
Re: displaying the details of a particular employee [message #168604 is a reply to message #168602] |
Fri, 21 April 2006 02:30 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
No problem, just try and work with Forms the way it was designed and you will find that you can create simple applications that work easily and quickly with very little programming effort on your part.
David
|
|
|