ORA-14551: cannot perform a DML operation inside a query error while using Execute immediate
<pre><code>CREATE OR REPLACE FUNCTION XXCHR_UPDATE      (
                                                                P_SALESREP_ID          IN   NUMBER,
                                                                p_COLUMN_NAME           IN     VARCHAR2,
                                                                P_COLUMN_VALUE            IN   varchar2
                                                           )
   RETURN VARCHAR2

IS

   lv_dyn_sql                        VARCHAR2(2000):= NULL;

BEGIN


        lv_dyn_sql := 'UPDATE thirty_days
                SET attribute86 ='||p_COLUMN_NAME||',attribute87 ='||P_COLUMN_VALUE
                || 'WHERE SALESREP_ID = :1';     

    EXECUTE IMMEDIATE lv_dyn_sql using P_SALESREP_ID;

    return(1);



EXCEPTION
      WHEN OTHERS
      THEN
         dbms_output.put_line('Returning Error : '||SQLERRM);
         --lv_return_val:= 0;
     RETURN SQLERRM;

END XXCHR_UPDATE;
</code></pre>

<p>When I execute this function its returning error </p>

<blockquote>
  <p>ORA-14551 </p>
</blockquote>

<p>please suggest here  </p>