inserting data in tabular form [message #78463] |
Mon, 25 February 2002 23:57  |
randy
Messages: 25 Registered: November 2000
|
Junior Member |
|
|
hi folks,
I'm trying to insert data in a tabular form, but I can't insert it further than the 1st row. I tried to use a cursor, but I get the error FRM-40102: Record must be entered or deleted first.
I tried with the block as non database table, and with next_record in the pl/sql statement, but it won't go further than the 1st row
thx for your help
|
|
|
|
Re: inserting data in tabular form [message #78474 is a reply to message #78466] |
Tue, 26 February 2002 01:02   |
randy
Messages: 25 Registered: November 2000
|
Junior Member |
|
|
thanks pratap for our help...
I tried with create_record, and no next_record at the end of the statement, but it's still not working. How are the different rows in a tabular form differentiated? isn't there some place in dev2k where u can tell it "go to the next row"? that should be implemented
|
|
|
|
Re: inserting data in tabular form [message #78478 is a reply to message #78466] |
Tue, 26 February 2002 02:20   |
randy
Messages: 25 Registered: November 2000
|
Junior Member |
|
|
i made this cursor:
cursor C1 IS
select empno,empname,empsal from emp where empstat='manager';
begin
open C1
loop
fetch c1 into :employee.empno,:employee.empname,:employee.empsal
exit when c1 %notfound
end loop;
end;
I have a 5 rows tabular form. What I want to do is display empno, empname, empsal from the 1st employee on the 1st row, then the 2nd employee in the 2nd row, and so on. when I have displayed the 5th employee, I want to click on "next 5 records" button, erase the tabular form and display the 6th employee on 1st row, 7th employee on 2nd row... until I displayed all employees.
I hope that's more understandable that way
thx a lot
|
|
|
Re: inserting data in tabular form [message #78480 is a reply to message #78466] |
Tue, 26 February 2002 02:39   |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
u r code is wrong. try this way, it should solve your problem.
declare
cursor C1 IS
select empno,empname,empsal from emp where empstat='manager';
begin
go_block('emp');
open C1;
loop
if :system.record_status!='NEW' then
create_record;
end if;
fetch c1 into :employee.empno,:employee.empname,:employee.empsal
exit when c1 %notfound;
end loop;
first_record;
end;
|
|
|
Re: inserting data in tabular form [message #78483 is a reply to message #78466] |
Tue, 26 February 2002 02:58  |
randy
Messages: 25 Registered: November 2000
|
Junior Member |
|
|
thanks a lot, now it's working! I just have one question: how can I display a message "no more rows" when the cursor reaches the last employee? because now when it reaches the last employee, the forms cursor stays in a table cell and won't move from it, with a FRM-40102 error. so what I want is to display a message and move the cursor before it stucks itself in the table cell.I know how to display a message, but here I don't know where to put it in the code exactly. any ideas?
|
|
|