Getting an error while trying to update the column of a table by calling a function to set it s value :PLS-00231
<p>Here's the update statement that's throwing an error:</p>

<blockquote>
  <p>PLS-00231: function 'F_GET_MUSTGO_LOOKAHEAD' may not be used in SQL</p>
</blockquote>

<pre><code>UPDATE gt_network gt
SET u_look_ahead = f_get_mustgo_lookahead(gt.u_smart_cd, gt.u_must_go_multi),
    u_must_go = f_get_mustgo_lookahead(gt.u_smart_cd, gt.u_look_ahead_multi); 
</code></pre>

<p><code>f_get_mustgo_lookahead</code> is a private function and parameters have been passed to this function with column values from the table.</p>

<pre><code>FUNCTION  f_get_mustgo_lookahead                                        --f_get_mustgo_lookahead function takes input parameters smart_code and multiplier and returns value for u_must_go and u_look_ahead
(in_smart_code IN varchar2, in_multiplier IN FLOAT)
RETURN  NUMBER
IS
l_type_mustgo_lookahead NUMBER;  

BEGIN

SELECT (closedt.eff - opendt.eff) INTO l_type_mustgo_lookahead          
FROM
(SELECT eff from (SELECT eff FROM scpomgr.caldata  WHERE cal=in_smart_code AND opt=1 order by eff )where rownum=1) opendt,
(SELECT eff from(SELECT eff FROM scpomgr.caldata  WHERE cal=in_smart_code AND  opt=2 order by eff )where rownum=1) closedt 
WHERE closedt.eff &gt; opendt.eff ;

RETURN (l_type_mustgo_lookahead * in_multiplier); 
EXCEPTION
WHEN NO_DATA_FOUND THEN                         
  RETURN 0;                        
END f_get_mustgo_lookahead;     
</code></pre>