empty loops

Discussion in 'Databases' started by Jamie18, Sep 4, 2009.

  1. #1
    just wondering if i can do this...

    say i have a function foo that returns a number between 0 and 10 every time it's called.. the first time it returns 10, the second time 9, etc.

    can i set up an empty loop that will call that function until it returns 0?

    like
    WHILE foo <> 0 LOOP
    END LOOP;
    Code (markup):
    or do i need to do something like this
    WHILE i <> 0 LOOP
       i = foo;
    END LOOP;
    Code (markup):
    just to be clear, foo was just an example function, my actual function will return results based on a query so using a FOR i = 1 to 10 style loop won't work
     
    Jamie18, Sep 4, 2009 IP
  2. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nevermind.. i'll just make my function recursive
     
    Jamie18, Sep 4, 2009 IP