How do you decide on whether to use a Procedure or a Function for a particular task ?Is it possible to get the last 10 rows of a table? If Yes How?

Questions by sathish_p

Showing Answers 1 - 2 of 2 Answers

jamesravid

  • Jul 18th, 2007
 

I would consider the following points,

1. Identify how many variable should be returned by your pl/sql code. If it is only one go for functions else go for procedures.

2. Fuctions can be used in ur sql queries whereas procedures can't be used.

  Was this answer useful?  Yes

jamesravid

  • Jul 18th, 2007
 

For ur second question,
select * from
  (select * from (select col1,col2,rownum as rank
                          from table) a
   order  by a.rank desc)
where rownum <=10

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions