6 Replies Latest reply on Feb 18, 2013 11:57 AM by Suri

    Quick question about functions

      Hi, I was wondering if you could help me out. I am writting a package which makes a call to a function. The function is basically a cursor which returns the id of a row if a row meets the given criteria in the select statement.

      Before I make the call to the function I have a variable in my package, lets call it v_variable. and lets say it has a value of 10.

      My question is if I assign v_variable to the value returned from the function, what happens if the cursor in the function does not retrieve any rows, does my variable stay 10 or get assigned null. ie.


      v_variable number;


      v_variable := 10;

      v_variable := test_funct;


      function test_funct return number is

      l_test_id number;

      select id
      into l_test_id
      from table
      where ..

      return l_test_id