My Oracle Support Banner

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

Last updated on AUGUST 04, 2018

Applies to:

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


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



To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.