Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00918 error

Murray SobolFeb 24 2016 — edited Feb 24 2016

I am getting this error:

Error report -

SQL Error: ORA-00918: column ambiguously defined

00918. 00000 -  "column ambiguously defined"

*Cause:   

*Action:

when I use this type of SQL syntax:

[CODE]

INSERT INTO a1_security_action (object_id,

                                discriminant,

                                action_nbr,

                                description,

                                sort_order

                               )

  WITH names AS

   (SELECT 'ABCE',

           'X',

           1,

           'Open',

           1

      FROM dual

     UNION ALL

    SELECT 'ABCE','X',2,'Terms',2

      FROM dual

     UNION ALL

    SELECT 'ACAIM','X',1,'G/L Distribution',1

      FROM dual

   )

SELECT * FROM names

/

[/CODE]

info a1_security_action
produces this result:

[CODE]

Columns
NAME           DATA TYPE            NULL  DEFAULT    COMMENTS
*ACTION_NBR    NUMBER(5,0)          No    1             
*DISCRIMINANT  VARCHAR2(10 BYTE)    No    'X'           
*OBJECT_ID     VARCHAR2(10 BYTE)    No                  
DESCRIPTION   VARCHAR2(100 BYTE)   No                  
SORT_ORDER    NUMBER(5,0)          No                  
Indexes
INDEX_NAME                      UNIQUENESS  STATUS  FUNCIDX_STATUS  COLUMNS                              COLUMN_EXPRESSION 
GRAINV18.PK_A1_SECURITY_ACTION  UNIQUE      VALID                   OBJECT_ID, DISCRIMINANT, ACTION_NBR                    

References
TABLE_NAME               CONSTRAINT_NAME              DELETE_RULE  STATUS   DEFERRABLE      VALIDATED  GENERATED 
A1_SECURITY_ACTION_ROLE  FK2_A1_SECURITY_ACTION_ROLE  NO ACTION    ENABLED  NOT DEFERRABLE  VALIDATED  USER NAME

[/CODE]

Any Ideas???

Thanks

This post has been answered by CarlosDLG on Feb 24 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2016
Added on Feb 24 2016
6 comments
678 views