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 OCTOBER 10, 2022

Applies to:

Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Information in this document applies to any platform.

Symptoms

NOTE: In the images and/or the document content below, the user information and data used represents fictitious data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product. Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner. 

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

  

Changes

 This issue has likely existed since the associated features were introduced but this has not been thoroughly investigated.

Cause

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
Symptoms
Changes
Cause
Solution
References


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