ORA-22816 on INSERT with RETURN clause into a Version Enabled Table (Doc ID 397765.1)

Last updated on APRIL 15, 2014

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.1 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Symptoms

Problem Statement
=============
Insert into a Version Enabled Table fails with:
ORA-22816: unsupported feature with RETURNING clause


Steps To Reproduce:
==============


1- Create Table with PK column

create table emp4(empno number, ename varchar2(20));
alter table emp4 add primary key(empno);


2- Version Enabled the table by executing the following

exec DBMS_WM.EnableVersioning('emp4');

 

3- Create a stored procedure to INSERT into that Table with Return clause

create or replace procedure testproc as
y NUMBER;
z varchar2(20);
begin
 insert into emp4(empno,ename) values(2222,'TEST2')
 return empno, lower(ename) into y, z;
end;
/


4- execute that stored procedure, this will fail with : ORA-22816

exec testproc ;

begin
*
ERROR at line 1:
ORA-22816: unsupported feature with RETURNING clause
ORA-6512: at line 2






Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms