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

后端 未结 3 472
自闭症患者
自闭症患者 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:54

    Just declare a variable to accept the return value, for example:

    declare
        retvar varchar2(4);
    begin
        retvar := supercomplex('somevalue');
    end;
    

    The select doesn't work because the function is performing an insert, if all it did was return a value then it would work.

提交回复
热议问题