Solution to “cannot perform a DML operation inside a query”?

后端 未结 3 480
自闭症患者
自闭症患者 2020-12-01 05:19

I am using a Data Analysis tool and the requirement I have was to accept a value from the user, pass that as a parameter and store it in a table. Pretty straighforward so I

3条回答
  •  清歌不尽
    2020-12-01 05:58

    Just execute the function in a dummy if ... end if; statement to ignore the return value:

    exec if supercomplex('somevalue') then null; end if;
    

    Or execute it as a parameter for put_line procedure to output the return value:

    exec dbms_ouput ('result of supercomplex='||supercomplex('somevalue'));
    
    result of supercomplex=done
    

提交回复
热议问题