DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Is this possible?

  1. #1
    Join Date
    Mar 2001
    Posts
    63
    I work extensively with views, and within those views I often use functions for a variety of reasons. No big surprises there.

    However, recently I have a problem where I need to list each day in between dates, as well as return some other data.

    Basically I was thinking:

    select x, y, find_z('Wednesday', 'Monday') from table a;

    to come out like:

    - - ----------------
    1 1 Monday
    1 1 Tuesday
    1 1 Wednesday

    I was thinking that I could make a function that has a loop in it, and within the loop, return the value for each day. However, once the loop within the function hits the return command, the function ends, so only one row is returned.

    Given, the days are real date fields, and I'm not specifically looking for day names, so returning a date is what I'm really looking for.

    Is there any possible way to get a function to make a loop like this?

  2. #2
    Join Date
    Jan 2002
    Posts
    15

    Arrow

    Hi,
    You can do similar sonthing like this :

    select x,y, findz(sysdate,rownum) from a;


    function findx(d date, r number)
    {
    rerunt d+ r
    }
    Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width