Home » Developer & Programmer » Reports & Discoverer » hoe to generate automatic number
hoe to generate automatic number [message #88981] Tue, 15 July 2003 08:55 Go to next message
saima zaidi
Messages: 1
Registered: July 2003
Junior Member
how to gernerato automatic numbers without using sequence
Re: hoe to generate automatic number [message #88983 is a reply to message #88981] Wed, 16 July 2003 02:20 Go to previous messageGo to next message
Rahman
Messages: 40
Registered: July 2003
Member
A.A.W.W.
hi saima!
if u consider emp table & Suppose first EmpNo is 7001 (whatever else) in first row of emp table
then follow the Steps:
Declare
Curr_EmpNo Number;
begin
select max(EmpNo) into Curr_EmpNo from emp
where level=1
connect by prior EmpNo > EmpNo
group by level;

Insert into emp values (Curr_EmpNo+1,........);

Hope u understand !!!!!!
bye
Rahman
Re: how to generate automatic number if no duplicate Numer is there [message #88984 is a reply to message #88983] Wed, 16 July 2003 02:29 Go to previous message
Rahman
Messages: 40
Registered: July 2003
Member
A.A.W.W.
hi saima!
only change the first SQL Statement if no duplicate number is there
change as follows:-
select max(EmpNo) into Curr_EmpNo from emp;
Insert into emp values (Curr_EmpNo+1,........);

bye
Rahman
Previous Topic: *****A tool for reports in HTMLCSS format , I thank it is useful
Next Topic: ***Exit report*** How to ?
Goto Forum:
  


Current Time: Tue Dec 17 21:40:48 CST 2024