Error ORA-918 When Adding VPD Policy To A Table With Hidden And Virtual Column (Doc ID 2053352.1)

Last updated on SEPTEMBER 28, 2015

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Information in this document applies to any platform.

Symptoms

ORA-918 when adding a VPD policy to a table with a hidden and a virtual column:

  

We create and alter a table as follows:

create table test1
    (v1  varchar2 (30),
     cloud_vpd_mandant number (8) invisible
            default sys_context('cloud_context', 'Mandant') ) ;

alter table test1 add virt_col INVISIBLE generated always as (1+1)  virtual;

Then we add a simple VPD policy returning predicate '1=1' for select.

Then we get:

SQL> select virt_col from test1;
select virt_col from test1
       *
ERROR at line 1:
ORA-00918: column ambiguously defined

With a VPD policy for insert/update/delete the error becomes:

SQL> select *  from test1 for update of virt_col;
select *  from test1 for update of virt_col
               *
ERROR at line 1:
ORA-28113: policy predicate has error

  

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