Auto Generated Record [message #318009] |
Mon, 05 May 2008 05:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kamran.it
Messages: 265 Registered: September 2005 Location: Karachi
|
Senior Member |
|
|
HI
I am using master and detail block. master in form and detial in tabular.
in MAster block it is working proerply but in detail block. I want that check the max no from detail block and add+1 with the row, if I inserted in detail 5 row that will generate recored accrodingly.
like. max(srno) = 5
I inserted 5 more record in detail
then replace with 6,7,8,9,10 like that.
see my following code.
I used the following code in detail block when create record
declare
v_sr number(4):=0;
begin
select max(ojobno) into v_sr from sub_fabric_rec ;
if v_sr is not null or v_sr<>0 then
:sub_fabric_rec.ojobno:= v_sr + :SYSTEM.cursor_record;
else
:sub_fabric_rec.ojobno:=1;
end if;
exception
when no_data_found then
:sub_fabric_rec.ojobno:=1;
end;
it is working but if I inserted 5 record in detail block first 2 rows Auto No are same??
and after 2nd row other reocords working accrodingly.
like
16
16
17
18
19
20 etc
|
|
|
|
|
|
|