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 00904 with insert all and ORA_ROWSCN

3264939Nov 24 2016 — edited Nov 25 2016

Hello,

Oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

Has anyone ever come across this before?

2nd insert statement throws a ORA 00904 invalid identifier error when the column ORA_ROWSCN is included in the select.

The code below is just for example purposes.  I know the column ORA_ROWSCN is not needed in the sql.

Insert select works ok but insert all seems to throw an error.

Cheers,

Dan

CREATE TABLE DCG_INSERT_INTO (TEST1 VARCHAR2(100),
                              TEST2 VARCHAR2(100),
                              TEST3 VARCHAR2(100));

CREATE TABLE DCG_INSERT_FROM (TEST1 VARCHAR2(100),
                              TEST2 VARCHAR2(100),
                              TEST3 VARCHAR2(100));

INSERT INTO DCG_INSERT_FROM VALUES (1,2,3);
INSERT INTO DCG_INSERT_FROM VALUES (4,5,6);
INSERT INTO DCG_INSERT_FROM VALUES (7,8,9);

INSERT ALL
INTO DCG_INSERT_INTO
(
  TEST1,
  TEST2,
  TEST3)
VALUES
(
  TEST1,
  TEST2,
  TEST3)
SELECT TEST1,
       TEST2,
       TEST3
  FROM DCG_INSERT_FROM ;

INSERT ALL
INTO DCG_INSERT_INTO
(
  TEST1,
  TEST2,
  TEST3)
VALUES
(
  TEST1,
  TEST2,
  TEST3)
SELECT TEST1,
       TEST2,
       TEST3,
       ORA_ROWSCN AS WHAT_IS_GOING_ON
  FROM DCG_INSERT_FROM;

This post has been answered by William Robertson on Nov 24 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2016
Added on Nov 24 2016
6 comments
956 views