oracle中bug之ORA-00904:”COS
笔者今天遇到一个oracle中的bug,详情请看小生细细道来。 换列名后,标示符还是无效 ORA-00904:”COS_0”: 标示符无效 如题,也许导致这个问题的原因很多,但是本文笔者所要描述的是由于创建表对象时,创建的语句里列名带有双引号问题。“”就是这个符号的原
笔者今天遇到一个oracle中的bug,详情请看小生细细道来。
换列名后,标示符还是无效ORA-00904:”COS_0”:标示符无效
如题,也许导致这个问题的原因很多,但是本文笔者所要描述的是由于创建表对象时,创建的语句里列名带有双引号问题。“”就是这个符号的原因。如下所示:
create table D_METER_SITECHK (
READ_ID NUMBER(16) not null,
METER_ID NUMBER(16) not null,
TEST_DEPT_NO VARCHAR2(16),
"Ua" NUMBER(12,4),
"Ub" NUMBER(12,4),
"Uc" NUMBER(12,4),
"la" NUMBER(12,4),
constraint PK_D_METER_SITECHK primary key (READ_ID)
);
以上语句里的双引号是怎么来的,一是通过建模工具,自动生成的时候,建模工具会默认把一些字段当成关键字,会莫名其妙给这些看似关键字的列名加上双引号‘“’。但是再PL/SQL创建表的时候,PL/SQL却不报错,而且创建出来的表几乎看不出任何问题。
可是当你对这个表做插入数据时却始终插不进去,无论你换任何列名,都无济于事。但是你执行select操作却能正常把数据查出来。很奇怪吧。
不管你换任何列名,只要你不把以上带双引号的四个列删掉,就会一直出错,但是你会发现,无论你怎么删除或者更改上述四个带双引号的列的列名,始终改不了。系统总是提示:ORA-00904:”COS_0” :标示符无效
解决这个问题的唯一办法就是,删掉这个表,当然如果这个表里的列是别的表的主键,那么其他的表也要受到关联。
重新创建表对象,从建模工具里复制自动生成的sql创建语句到记事本里,然后把双引号去掉。
完事,此问题得到解决。
大概这是oracle的bug吧。
带双引号的列,能创建成功,但是无法对这个表对象做任何操作。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

The steps to open an Oracle database are as follows: Open the Oracle database client and connect to the database server: connect username/password@servername Use the SQLPLUS command to open the database: SQLPLUS

Triggers in Oracle are stored procedures used to automatically perform operations after a specific event (insert, update, or delete). They are used in a variety of scenarios, including data verification, auditing, and data maintenance. When creating a trigger, you need to specify the trigger name, association table, trigger event, and trigger time. There are two types of triggers: the BEFORE trigger is fired before the operation, and the AFTER trigger is fired after the operation. For example, the BEFORE INSERT trigger ensures that the age column of the inserted row is not negative.

The macOS operating system was invented by Apple. Its predecessor, System Software, was launched in 1984. After many iterations, it was updated to Mac OS X in 2001 and changed its name to macOS in 2012.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

Two ways to rename Oracle table names: use SQL statements: ALTER TABLE <Old table name> RENAME TO <New table name>;Use PL/SQL statements: EXECUTE IMMEDIATE 'ALTER TABLE ' || :old_table_name || ' RENAME TO ' || :new_table_name;
