find total row

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mixupatel
    New Member
    • Dec 2012
    • 3

    find total row

    Code:
    create or replace function fun_getnoofrows(p_empcode number,p1_date varchar2,p2_date varchar2) return number as
      v_cnt number ;
     
      i number:=0;
      days number:=0;
      begin
      select  count(1)into v_cnt 
      from inouttime 
      where empcode=p_empcode and 
      to_date(attnddate,'DD-MM-YYYY') 
            between to_date(p1_date,'DD-MM-YYYY') and 
            to_date(p2_date,'DD-MM-YYYY');
            
       
        while i=30 
        loop
        IF v_cnt>0 then
        days :=days+1;
        end if;
                     
        i:=i+1;
        
        
        
        end loop;
    return days;
      end;
    hey this is my function now this is not return value and i want to return total number of v_cnt row
    Last edited by acoder; Jan 2 '13, 12:28 AM.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Bytes is not a code writing nor homework service. Please read the FAQ and posting guidlines before posting your question.

    This appears to be a homework question and as such may be deleted.

    By, simply stating that your code "doesn't work," and expecting someone to help doesn't usually result in much of an answer and may result in your thread being deleted.
    Instead, please tell us what you were expecting to happen, what actually happened, for each error: the EXACT title, error number, and descriptions that occurred and at what line in your posted code the error occurred. These are the minimum requirements for posting a question of this nature.

    Comment

    Working...