ORA-00976 When Using ROWNUM as Values For Insert (Doc ID 1334406.1)

Last updated on SEPTEMBER 02, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 01-Sep-2017***

Symptoms

After Upgrading From 10GR2 To 11GR2 , The Existing Code That Used To Work In 10GR2 Now Failing With The Following Error :


on 11.2 :
---------

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table msg_tbl (c1 varchar2(4),c2 number);

Table created.

SQL> insert into msg_tbl values('dd',rownum);
insert into msg_tbl values('dd',rownum)
*
ERROR at line 1:
ORA-00976: Specified pseudocolumn or operator not allowed here.



on 10g :
--------

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create table msg_tbl (c1 varchar2(4),c2 number);

Table created.

SQL> insert into msg_tbl values('dd',rownum);

1 row created.

SQL> select * from msg_tbl;

C1 C2
---- ----------
dd 0

Changes

Upgrading From 10GR2 To 11GR2

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