Skip to content
Advertisement

Oracle INSERT with a CASE statement

I have the following table declaration and I’m trying to use a case statement to INSERT some rows and I’m getting the following error

ORA-00976: Specified pseudocolumn or operator not allowed here.

Can someone please let me know how to rectify the INSERT code.

Thanks in advance to all who answer.

Advertisement

Answer

level pseudocolumn goes with select (not just values).

I modified your code a little bit (I’m on 11gXE, it doesn’t allow partitions nor identity columns – you can leave both of those if your database supports them). Also, NOT NULL constraint should be removed for the state column.

Insert:

Result:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement