Package logic [message #244373] |
Tue, 12 June 2007 08:39 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi,
I have requirement that once the number of rows inserted to a table is 99 then the new insert i.e, 100 should start updating the record from first record.
the table should allow only 99 records and the next records should go on updating from first.
Can i implement this with any easy way using any new built in .
i am working with a package which do the above.
Thanks,
Srinivas
|
|
|
Re: Package logic [message #244388 is a reply to message #244373] |
Tue, 12 June 2007 09:35 |
sanka_yanka
Messages: 184 Registered: October 2005 Location: Kolkata
|
Senior Member |
|
|
try out this logic
declare
row_number number;
begin
select test_seq.nextval
into row_number
from dual;
if row_number > 100 then
update statement;
-- In where condition you have to use the primary key field compared with mod(row_number,100)
else
insert statement;
end if;
end;
|
|
|