Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help: A difficult request
Użytkownik Joe Bayer <u705413818_at_spawnkill.ip-mobilphone.net> w wiadomooci do grup dyskusyjnych
napisał:l.1021582008.1213226318@[64.94.198.252]...
> My boss asks me to let user select from a table for only one row each
> time, which is very difficult to achieve
If you need this in application try this:
Package TMP_count IS
vn_counter number(10);
vn_max number(10);
FUNCTION getCounter RETURN number;
PROCEDURE IncCounter;
END; -- Package Specification TMP_TEST
Package Body TMP_COUNT IS
FUNCTION getCounter RETURN number IS
BEGIN
dbms_output.put_line(vn_counter);
RETURN vn_counter;
END;
PROCEDURE IncCounter IS
BEGIN
if vn_counter<vn_max then
vn_counter:=vn_counter+1;
else
vn_counter:=1; --set to start or raise exception
end if;
END;
BEGIN
vn_counter:=1;
Select count(0) Into vn_max --count of all rows
from tmp_test;
END; -- Package Body TMP_COUNT
The counter is global for your session so everyone can run another application and get all the data from table because counter starts from 1
I'm not sure but this should work (I tested it and it looks OK)...
Greeting,
Henry
-- Henryk Galuhn E-Mail: hfoto_at_poczta.fmReceived on Fri May 17 2002 - 03:11:58 CDT
![]() |
![]() |